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

Side by Side Diff: test/mjsunit/debug-evaluate-nested.js

Issue 2505363002: [debug-wrapper] Adapt tests, breakpoint.actual_location (Closed)
Patch Set: Rebase Created 4 years 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
« no previous file with comments | « test/mjsunit/debug-evaluate-locals.js ('k') | test/mjsunit/debug-is-active.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 Debug = debug.Debug;
8 ScopeType = debug.ScopeType;
9 var exception = null;
10 var nested = false;
11
12 function bar() {
13 let a = 1;
14 (function foo() {
15 let b = a;
16 with (new Proxy({}, {})) {
17 debugger;
18 }
19 })();
20 }
21
22 function checkScopes(scopes, expectation) {
23 assertEquals(scopes.map(s => s.scopeType()), expectation);
24 }
25
26 function listener(event, exec_state, event_data, data) {
27 if (event != Debug.DebugEvent.Break) return;
28 try {
29 if (!nested) {
30 nested = true;
31 checkScopes(exec_state.frame(0).allScopes(),
32 [ ScopeType.With, ScopeType.Local, ScopeType.Closure,
33 ScopeType.Script, ScopeType.Global ]);
34 exec_state.frame(0).evaluate("debugger;");
35 } else {
36 checkScopes(exec_state.frame(0).allScopes(),
37 [ ScopeType.Eval, ScopeType.With, ScopeType.Closure,
38 ScopeType.Script, ScopeType.Global ]);
39 }
40 } catch (e) {
41 exception = e;
42 print(e + e.stack);
43 }
44 }
45
46 Debug.setListener(listener);
47 bar();
48 Debug.setListener(null);
49 assertNull(exception);
OLDNEW
« no previous file with comments | « test/mjsunit/debug-evaluate-locals.js ('k') | test/mjsunit/debug-is-active.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698