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

Side by Side Diff: test/mjsunit/debug-evaluate-shadowed-context-2.js

Issue 2466273005: [debugger] Further stepping support in test wrapper (Closed)
Patch Set: Move more tests 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
« no previous file with comments | « test/mjsunit/debug-evaluate-modify-this.js ('k') | test/mjsunit/debug-generator-break.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 --no-analyze-environment-liveness
6
7 // Test that debug-evaluate correctly collects free outer variables
8 // and does not get confused by variables in nested scopes.
9
10 Debug = debug.Debug
11
12 var exception = null;
13 function listener(event, exec_state, event_data, data) {
14 if (event != Debug.DebugEvent.Break) return;
15 try {
16 assertThrows(() => exec_state.frame(0).evaluate("x").value());
17 } catch (e) {
18 exception = e;
19 print(e + e.stack);
20 }
21 }
22
23 Debug.setListener(listener);
24
25 (function() {
26 var x = 1; // context allocate x
27 (() => x);
28 (function() {
29 var x = 2; // stack allocate shadowing x
30 (function() {
31 { // context allocate x in a nested scope
32 let x = 3;
33 (() => x);
34 }
35 debugger;
36 })();
37 })();
38 })();
39
40 Debug.setListener(null);
41 assertNull(exception);
OLDNEW
« no previous file with comments | « test/mjsunit/debug-evaluate-modify-this.js ('k') | test/mjsunit/debug-generator-break.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698