OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 InspectorTest.addScript(` |
| 6 var self = this; |
| 7 function checkPrototype() { |
| 8 const prototype1 = Object.getPrototypeOf(console); |
| 9 const prototype2 = Object.getPrototypeOf(prototype1); |
| 10 if (Object.getOwnPropertyNames(prototype1).length !== 0) |
| 11 return "false: The [[Prototype]] must have no properties"; |
| 12 if (prototype2 !== Object.prototype) |
| 13 return "false: The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%"; |
| 14 return "true"; |
| 15 } |
| 16 `); |
| 17 |
| 18 InspectorTest.runAsyncTestSuite([ |
| 19 async function consoleExistsOnGlobal() { |
| 20 let message = await Protocol.Runtime.evaluate({ |
| 21 expression: 'self.hasOwnProperty(\'console\')', returnByValue: true}); |
| 22 InspectorTest.log(message.result.result.value); |
| 23 }, |
| 24 |
| 25 async function consoleHasRightPropertyDescriptor() { |
| 26 let message = await Protocol.Runtime.evaluate({ |
| 27 expression: 'Object.getOwnPropertyDescriptor(self, \'console\')', |
| 28 returnByValue: true}); |
| 29 let result = message.result.result.value; |
| 30 result.value = '<value>'; |
| 31 InspectorTest.logObject(result); |
| 32 }, |
| 33 |
| 34 async function ConsoleNotExistsOnGlobal() { |
| 35 let message = await Protocol.Runtime.evaluate({ |
| 36 expression: '\'Console\' in self', returnByValue: true}) |
| 37 InspectorTest.log(message.result.result.value); |
| 38 }, |
| 39 |
| 40 async function prototypeChainMustBeCorrect() { |
| 41 let message = await Protocol.Runtime.evaluate({ |
| 42 expression: "checkPrototype()", returnByValue: true }); |
| 43 InspectorTest.log(message.result.result.value); |
| 44 }, |
| 45 |
| 46 async function consoleToString() { |
| 47 let message = await Protocol.Runtime.evaluate({ |
| 48 expression: 'console.toString()', returnByValue: true}) |
| 49 InspectorTest.log(message.result.result.value); |
| 50 } |
| 51 ]); |
OLD | NEW |