Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: test/mjsunit/es6/debug-scope-default-param-with-eval.js

Issue 2505363002: [debug-wrapper] Adapt tests, breakpoint.actual_location (Closed)
Patch Set: Rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Flags: --expose-debug-as debug
6
7 // Test that the parameter initialization block scope set up for
8 // sloppy eval is visible to the debugger.
9
10 var Debug = debug.Debug;
11 var exception = null;
12 var break_count = 0;
13
14 function call_for_break() {
15 return 5;
16 }
17
18 function test(x = eval("var y = 7; debugger; y") + call_for_break()) {
19 return x;
20 }
21
22 function listener(event, exec_state, event_data, data) {
23 if (event != Debug.DebugEvent.Break) return;
24 try {
25 var frame = exec_state.frame(0);
26 var block_scope;
27 if (break_count++ == 0) {
28 // Inside eval.
29 assertEquals([ debug.ScopeType.Eval,
30 debug.ScopeType.Block,
31 debug.ScopeType.Closure,
32 debug.ScopeType.Script,
33 debug.ScopeType.Global ],
34 frame.allScopes().map(s => s.scopeType()));
35 exec_state.prepareStep(Debug.StepAction.StepOut);
36 block_scope = frame.scope(1);
37 } else {
38 // Outside of eval.
39 assertEquals([ debug.ScopeType.Block,
40 debug.ScopeType.Local,
41 debug.ScopeType.Script,
42 debug.ScopeType.Global ],
43 frame.allScopes().map(s => s.scopeType()));
44 block_scope = frame.scope(0);
45 }
46 assertTrue(block_scope.scopeObject().propertyNames().includes('y'));
47 assertEquals(7, block_scope.scopeObject().property('y').value().value());
48 } catch (e) {
49 print(e);
50 exception = e;
51 }
52 }
53
54 Debug.setListener(listener);
55
56 assertEquals(12, test());
57
58 Debug.setListener(null);
59
60 assertNull(exception);
61 assertEquals(2, break_count);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/debug-promises/reject-with-undefined-reject.js ('k') | test/mjsunit/es6/debug-stepin-microtasks.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698