OLD | NEW |
1 // Copyright 2017 the V8 project authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 InspectorTest.addScript(` | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Tests console objec
t and it\'s prototype'); |
| 6 |
| 7 contextGroup.addScript(` |
6 var self = this; | 8 var self = this; |
7 function checkPrototype() { | 9 function checkPrototype() { |
8 const prototype1 = Object.getPrototypeOf(console); | 10 const prototype1 = Object.getPrototypeOf(console); |
9 const prototype2 = Object.getPrototypeOf(prototype1); | 11 const prototype2 = Object.getPrototypeOf(prototype1); |
10 if (Object.getOwnPropertyNames(prototype1).length !== 0) | 12 if (Object.getOwnPropertyNames(prototype1).length !== 0) |
11 return "false: The [[Prototype]] must have no properties"; | 13 return "false: The [[Prototype]] must have no properties"; |
12 if (prototype2 !== Object.prototype) | 14 if (prototype2 !== Object.prototype) |
13 return "false: The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%"; | 15 return "false: The [[Prototype]]'s [[Prototype]] must be %ObjectPrototype%"; |
14 return "true"; | 16 return "true"; |
15 } | 17 } |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 InspectorTest.log(message.result.result.value); | 51 InspectorTest.log(message.result.result.value); |
50 }, | 52 }, |
51 | 53 |
52 async function consoleMethodPropertyDescriptor() { | 54 async function consoleMethodPropertyDescriptor() { |
53 let message = await Protocol.Runtime.evaluate({ | 55 let message = await Protocol.Runtime.evaluate({ |
54 expression: 'Object.getOwnPropertyDescriptor(console, \'log\')', | 56 expression: 'Object.getOwnPropertyDescriptor(console, \'log\')', |
55 returnByValue: true}); | 57 returnByValue: true}); |
56 InspectorTest.logObject(message.result.result.value); | 58 InspectorTest.logObject(message.result.result.value); |
57 } | 59 } |
58 ]); | 60 ]); |
OLD | NEW |