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

Side by Side Diff: test/mjsunit/es6/debug-promises/promise-race-caught.js

Issue 2487673002: [debugger] Basic scope functionality and exception events in wrapper (Closed)
Patch Set: Formatting 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 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 --allow-natives-syntax
6
7 // Test debug events when we only listen to uncaught exceptions and a
8 // Promise p3 created by Promise.race has a catch handler, and is rejected
9 // because one of the Promises p2 passed to Promise.all is rejected. We
10 // expect no Exception debug event to be triggered, since p3 and by
11 // extension p2 have a catch handler.
12
13 var Debug = debug.Debug;
14
15 var expected_events = 2;
16
17 var p1 = Promise.resolve();
18 p1.name = "p1";
19
20 var p2 = p1.then(function() {
21 throw new Error("caught");
22 });
23
24 p2.name = "p2";
25
26 var p3 = Promise.all([p2]);
27 p3.name = "p3";
28
29 p3.catch(function(e) {});
30
31 function listener(event, exec_state, event_data, data) {
32 try {
33 assertTrue(event != Debug.DebugEvent.Exception)
34 } catch (e) {
35 %AbortJS(e + "\n" + e.stack);
36 }
37 }
38
39 Debug.setBreakOnUncaughtException();
40 Debug.setListener(listener);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/debug-promises/promise-all-caught.js ('k') | test/mjsunit/es6/debug-promises/reentry.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698