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

Side by Side Diff: test/mjsunit/es6/default-parameters-debug.js

Issue 2497973002: [debug-wrapper] Further extend the debug wrapper (Closed)
Patch Set: Address comments 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/es6/debug-stepnext-for.js ('k') | test/mjsunit/es6/regress/regress-468661.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 2015 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 // Get the Debug object exposed from the debug context global object.
8 Debug = debug.Debug
9
10 listenerComplete = false;
11 breakPointCount = 0;
12 exception = null;
13
14 function listener(event, exec_state, event_data, data) {
15 if (event != Debug.DebugEvent.Break) return;
16 try {
17 breakPointCount++;
18 if (breakPointCount == 1) {
19 // Break point in initializer for parameter `a`, invoked by
20 // initializer for parameter `b`
21 assertEquals('default', exec_state.frame(0).evaluate('mode').value());
22 assertTrue(exec_state.frame(1).evaluate('b').isUndefined());
23 assertTrue(exec_state.frame(1).evaluate('c').isUndefined());
24 } else if (breakPointCount == 2) {
25 // Break point in IIFE initializer for parameter `c`
26 assertEquals('modeFn', exec_state.frame(1).evaluate('a.name').value());
27 assertEquals('default', exec_state.frame(1).evaluate('b').value());
28 assertTrue(exec_state.frame(1).evaluate('c').isUndefined());
29 } else if (breakPointCount == 3) {
30 // Break point in function body --- `c` parameter is shadowed
31 assertEquals('modeFn', exec_state.frame(0).evaluate('a.name').value());
32 assertEquals('default', exec_state.frame(0).evaluate('b').value());
33 assertEquals('local', exec_state.frame(0).evaluate('d').value());
34 }
35 } catch (e) {
36 exception = e;
37 }
38 };
39
40 // Add the debug event listener.
41 Debug.setListener(listener);
42
43 function f(a = function modeFn(mode) { debugger; return mode; },
44 b = a("default"),
45 c = (function() { debugger; })()) {
46 var d = 'local';
47 debugger;
48 };
49
50 f();
51
52 // Make sure that the debug event listener vas invoked.
53 assertEquals(3, breakPointCount);
54 assertNull(exception);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/debug-stepnext-for.js ('k') | test/mjsunit/es6/regress/regress-468661.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698