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

Side by Side Diff: test/mjsunit/harmony/async-debug-caught-exception.js

Issue 2244003003: Change which ExceptionEvents are triggered by Promises (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fixed typos Created 4 years, 3 months 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-promises/reject-uncaught-uncaught.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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: --allow-natives-syntax --harmony-async-await --expose-debug-as debug 5 // Flags: --allow-natives-syntax --harmony-async-await --expose-debug-as debug
6 6
7 Debug = debug.Debug 7 Debug = debug.Debug
8 8
9 var exception = null; 9 var exception = null;
10 var log; 10 var log;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 // Caught reject, events on uncaught exception. 80 // Caught reject, events on uncaught exception.
81 log = []; 81 log = [];
82 Debug.setListener(listener); 82 Debug.setListener(listener);
83 Debug.setBreakOnUncaughtException(); 83 Debug.setBreakOnUncaughtException();
84 caught_reject(); 84 caught_reject();
85 %RunMicrotasks(); 85 %RunMicrotasks();
86 Debug.setListener(null); 86 Debug.setListener(null);
87 Debug.clearBreakOnUncaughtException(); 87 Debug.clearBreakOnUncaughtException();
88 assertEquals([], log); 88 assertEquals([], log);
89 assertNull(exception); 89 assertNull(exception);
90
91 log = [];
92 Debug.setListener(listener);
93 Debug.setBreakOnException();
94
95 // "rethrown" uncaught exceptions in return don't cause another event
96 async function propagate_inner() { return thrower(); }
97 async function propagate_outer() { return propagate_inner(); }
98
99 propagate_outer();
100 %RunMicrotasks();
101 assertEquals(["a"], log);
102 assertNull(exception);
103
104 // Also don't propagate if an await interceded
105 log = [];
106 async function propagate_await() { await 1; return thrower(); }
107 async function propagate_await_outer() { return propagate_await(); }
108 propagate_await_outer();
109 %RunMicrotasks();
110 assertEquals(["a"], log);
111 assertNull(exception);
112
113 Debug.clearBreakOnException();
114 Debug.setBreakOnUncaughtException();
115
116 log = [];
117 Promise.resolve().then(() => Promise.reject()).catch(() => log.push("d")); // Ex ception c
118 %RunMicrotasks();
119 assertEquals(["d"], log);
120 assertNull(exception);
121
122 Debug.clearBreakOnUncaughtException();
123 Debug.setListener(null);
OLDNEW
« no previous file with comments | « test/mjsunit/es6/debug-promises/reject-uncaught-uncaught.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698