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

Side by Side Diff: test/debugger/debug/es6/debug-evaluate-receiver-before-super.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
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-debug-as debug
6 5
7 // Test that debug-evaluate doesn't crash when this is used before super() call 6 // Test that debug-evaluate doesn't crash when this is used before super() call
8 // in constructor. 7 // in constructor.
9 8
10 Debug = debug.Debug 9 Debug = debug.Debug
11 10
12 var result; 11 var result;
13 12
14 function listener(event, exec_state, event_data, data) 13 function listener(event, exec_state, event_data, data)
15 { 14 {
16 try { 15 try {
17 if (event == Debug.DebugEvent.Break) { 16 if (event == Debug.DebugEvent.Break) {
18 result = exec_state.frame(0).evaluate("this.a").value(); 17 result = exec_state.frame(0).evaluate("this.a").value();
19 } 18 }
20 } catch (e) { 19 } catch (e) {
21 result = e.message; 20 result = e.message;
22 } 21 }
23 } 22 }
24 23
25 Debug.setListener(listener); 24 Debug.setListener(listener);
26 25
27 class A { constructor () { this.a = 239; } } 26 class A { constructor () { this.a = 239; } }
28 class B extends A { 27 class B extends A {
29 constructor () { 28 constructor () {
30 debugger; 29 debugger;
31 assertEquals("Cannot read property 'a' of undefined", result); 30 assertTrue(result.indexOf("Cannot read property 'a' of undefined") >= 0);
32 super(); 31 super();
33 debugger; 32 debugger;
34 assertEquals(239, result); 33 assertEquals(239, result);
35 } 34 }
36 } 35 }
37 new B(); 36 new B();
38 37
39 Debug.setListener(null); 38 Debug.setListener(null);
OLDNEW
« no previous file with comments | « test/debugger/debug/es6/debug-evaluate-blockscopes.js ('k') | test/debugger/debug/es6/debug-exception-generators.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698