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

Side by Side Diff: test/mjsunit/regress/regress-crbug-323936.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 2014 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
9 var step = 0;
10 var exception = null;
11
12 function listener(event, exec_state, event_data, data) {
13 if (event != Debug.DebugEvent.Break) return;
14 try {
15 if (step == 0) {
16 assertEquals("error", exec_state.frame(0).evaluate("e").value());
17 exec_state.frame(0).evaluate("write_0('foo')");
18 exec_state.frame(0).evaluate("write_1('modified')");
19 } else {
20 assertEquals("argument", exec_state.frame(0).evaluate("e").value());
21 exec_state.frame(0).evaluate("write_2('bar')");
22 }
23 step++;
24 } catch (e) {
25 print(e + e.stack);
26 exception = e;
27 }
28 }
29
30 Debug.setListener(listener);
31
32 function f(e, x) {
33 try {
34 throw "error";
35 } catch(e) {
36 // In ES2015 hoisting semantics, 'x' binds to the argument
37 // and 'e' binds to the exception.
38 function write_0(v) { e = v }
39 function write_1(v) { x = v }
40 debugger;
41 assertEquals("foo", e); // overwritten by the debugger
42 }
43 assertEquals("argument", e); // debugger did not overwrite
44 function write_2(v) { e = v }
45 debugger;
46 assertEquals("bar", e);
47 assertEquals("modified", x);
48 }
49
50 f("argument")
51 assertNull(exception);
52 assertEquals(2, step);
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-crbug-107996.js ('k') | test/mjsunit/regress/regress-crbug-467180.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698