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.addScript( | 5 let {session, contextGroup, Protocol} = InspectorTest.start('Tests that variable
s introduced in eval scopes are accessible'); |
| 6 |
| 7 contextGroup.addScript( |
6 `function testNonEmptyEvalScope() { | 8 `function testNonEmptyEvalScope() { |
7 eval("'use strict'; var hest = 420; debugger;"); | 9 eval("'use strict'; var hest = 420; debugger;"); |
8 } | 10 } |
9 function testEmptyEvalScope() { | 11 function testEmptyEvalScope() { |
10 eval("var fisk = 42; testNonEmptyEvalScope();"); | 12 eval("var fisk = 42; testNonEmptyEvalScope();"); |
11 }`); | 13 }`); |
12 | 14 |
13 Protocol.Debugger.enable(); | 15 Protocol.Debugger.enable(); |
14 Protocol.Debugger.oncePaused().then(dumpScopeOnPause); | 16 Protocol.Debugger.oncePaused().then(dumpScopeOnPause); |
15 Protocol.Runtime.evaluate({ "expression": "testEmptyEvalScope();" }); | 17 Protocol.Runtime.evaluate({ "expression": "testEmptyEvalScope();" }); |
(...skipping 18 matching lines...) Expand all Loading... |
34 } | 36 } |
35 } | 37 } |
36 | 38 |
37 function dumpProperties(message) | 39 function dumpProperties(message) |
38 { | 40 { |
39 InspectorTest.logMessage(message); | 41 InspectorTest.logMessage(message); |
40 --waitScopeObjects; | 42 --waitScopeObjects; |
41 if (!waitScopeObjects) | 43 if (!waitScopeObjects) |
42 Protocol.Debugger.resume().then(InspectorTest.completeTest); | 44 Protocol.Debugger.resume().then(InspectorTest.completeTest); |
43 } | 45 } |
OLD | NEW |