OLD | NEW |
1 // Copyright 2016 the V8 project authors. All rights reserved. | 1 // Copyright 2016 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.log("Tests that property defined on console.__proto__ doesn't obse
rvable on other Objects."); | 5 let {session, contextGroup, Protocol} = InspectorTest.start("Tests that property
defined on console.__proto__ doesn't observable on other Objects."); |
6 | 6 |
7 InspectorTest.addScript(` | 7 contextGroup.addScript(` |
8 function testFunction() | 8 function testFunction() |
9 { | 9 { |
10 var amountOfProperties = 0; | 10 var amountOfProperties = 0; |
11 for (var p in {}) | 11 for (var p in {}) |
12 ++amountOfProperties; | 12 ++amountOfProperties; |
13 console.__proto__.debug = 239; | 13 console.__proto__.debug = 239; |
14 for (var p in {}) | 14 for (var p in {}) |
15 --amountOfProperties; | 15 --amountOfProperties; |
16 return amountOfProperties; | 16 return amountOfProperties; |
17 }`); | 17 }`); |
18 | 18 |
19 Protocol.Runtime.evaluate({ "expression": "testFunction()" }).then(dumpResult); | 19 Protocol.Runtime.evaluate({ "expression": "testFunction()" }).then(dumpResult); |
20 | 20 |
21 function dumpResult(result) | 21 function dumpResult(result) |
22 { | 22 { |
23 InspectorTest.logMessage(result); | 23 InspectorTest.logMessage(result); |
24 InspectorTest.completeTest(); | 24 InspectorTest.completeTest(); |
25 } | 25 } |
OLD | NEW |