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

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

Issue 2491543002: [debug-wrapper] Conditional breaks, locals, evaluate, scopes (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 --allow-natives-syntax
6
7 Debug = debug.Debug
8
9 var exception = null;
10
11 function f() {
12 let a = 0;
13 function g() {
14 let a = 1;
15 {
16 let a = 2;
17 debugger; // Breakpoint.
18 if (a !== 3) {
19 // We cannot change stack locals in optimized frames.
20 assertEquals(2, a);
21 assertOptimized(g);
22 }
23 }
24 assertEquals(1, a);
25 }
26 g.call(1);
27 if (a !== 4) {
28 // We cannot change stack locals in optimized frames.
29 assertEquals(0, a);
30 assertOptimized(f);
31 }
32 }
33
34
35 function listener(event, exec_state, event_data, data) {
36 if (event != Debug.DebugEvent.Break) return;
37 try {
38 exec_state.frame(0).evaluate("a = 3");
39 exec_state.frame(1).evaluate("a = 4");
40 assertThrows(() => exec_state.frame(0).evaluate("this = 2"));
41 } catch (e) {
42 exception = e;
43 print("Caught something. " + e + " " + e.stack);
44 };
45 };
46
47 Debug.setListener(listener);
48
49 f();
50
51 Debug.setListener(null);
52 assertNull(exception);
OLDNEW
« no previous file with comments | « test/mjsunit/debug-evaluate-modify-catch-block-scope.js ('k') | test/mjsunit/debug-evaluate-with.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698