@@ -17,20 +17,11 @@ const script = `
17
17
outer: false,
18
18
inner: true
19
19
});
20
+ const script = new vm.Script("outer");
20
21
debugger;
21
22
22
- const scriptMain = new vm.Script("outer");
23
- debugger;
24
-
25
- const scriptContext = new vm.Script("inner", {
26
- [kParsingContext]: context
27
- });
28
- debugger;
29
-
30
- assert.strictEqual(scriptMain.runInThisContext(), true);
31
- assert.strictEqual(scriptMain.runInContext(context), false);
32
- assert.strictEqual(scriptContext.runInThisContext(), false);
33
- assert.strictEqual(scriptContext.runInContext(context), true);
23
+ assert.strictEqual(script.runInThisContext(), true);
24
+ assert.strictEqual(script.runInContext(context), false);
34
25
debugger;
35
26
36
27
vm.runInContext('inner', context);
@@ -68,32 +59,22 @@ async function runTests() {
68
59
const topContext = await getContext ( session ) ;
69
60
await session . send ( { 'method' : 'Debugger.resume' } ) ;
70
61
const childContext = await getContext ( session ) ;
71
- await session . waitForBreakOnLine ( 13 , '[eval]' ) ;
72
-
73
- console . error ( '[test]' , 'Script associated with current context by default' ) ;
74
- await session . send ( { 'method' : 'Debugger.resume' } ) ;
75
- await checkScriptContext ( session , topContext ) ;
76
- await session . waitForBreakOnLine ( 16 , '[eval]' ) ;
77
-
78
- console . error ( '[test]' , 'Script associated with selected context' ) ;
79
- await session . send ( { 'method' : 'Debugger.resume' } ) ;
80
- await checkScriptContext ( session , childContext ) ;
81
- await session . waitForBreakOnLine ( 21 , '[eval]' ) ;
62
+ await session . waitForBreakOnLine ( 14 , '[eval]' ) ;
82
63
83
64
console . error ( '[test]' , 'Script is unbound' ) ;
84
65
await session . send ( { 'method' : 'Debugger.resume' } ) ;
85
- await session . waitForBreakOnLine ( 27 , '[eval]' ) ;
66
+ await session . waitForBreakOnLine ( 18 , '[eval]' ) ;
86
67
87
68
console . error ( '[test]' , 'vm.runInContext associates script with context' ) ;
88
69
await session . send ( { 'method' : 'Debugger.resume' } ) ;
89
70
await checkScriptContext ( session , childContext ) ;
90
- await session . waitForBreakOnLine ( 30 , '[eval]' ) ;
71
+ await session . waitForBreakOnLine ( 21 , '[eval]' ) ;
91
72
92
73
console . error ( '[test]' , 'vm.runInNewContext associates script with context' ) ;
93
74
await session . send ( { 'method' : 'Debugger.resume' } ) ;
94
75
const thirdContext = await getContext ( session ) ;
95
76
await checkScriptContext ( session , thirdContext ) ;
96
- await session . waitForBreakOnLine ( 33 , '[eval]' ) ;
77
+ await session . waitForBreakOnLine ( 24 , '[eval]' ) ;
97
78
98
79
console . error ( '[test]' , 'vm.runInNewContext can contain debugger statements' ) ;
99
80
await session . send ( { 'method' : 'Debugger.resume' } ) ;
0 commit comments