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

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

Issue 2361333003: Fix crash from turning on DevTools in the middle of catch prediction (Closed)
Patch Set: Format Created 4 years, 2 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
« src/isolate.cc ('K') | « src/isolate.cc ('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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 Debug.setBreakOnUncaughtException(); 114 Debug.setBreakOnUncaughtException();
115 115
116 log = []; 116 log = [];
117 Promise.resolve().then(() => Promise.reject()).catch(() => log.push("d")); // Ex ception c 117 Promise.resolve().then(() => Promise.reject()).catch(() => log.push("d")); // Ex ception c
118 %RunMicrotasks(); 118 %RunMicrotasks();
119 assertEquals(["d"], log); 119 assertEquals(["d"], log);
120 assertNull(exception); 120 assertNull(exception);
121 121
122 Debug.clearBreakOnUncaughtException(); 122 Debug.clearBreakOnUncaughtException();
123 Debug.setListener(null); 123 Debug.setListener(null);
124
125 // If devtools is turned on in the middle, then catch prediction
126 // could be wrong (here, it mispredicts the exception as caught),
127 // but shouldn't crash.
128
129 log = [];
130
131 var resolve;
132 var turnOnListenerPromise = new Promise(r => resolve = r);
133 async function confused() {
134 await turnOnListenerPromise;
135 throw foo
136 }
137 confused();
138 Promise.resolve().then(() => {
139 Debug.setListener(listener);
140 Debug.setBreakOnUncaughtException();
141 resolve();
142 });
143
144 assertEquals([], log);
OLDNEW
« src/isolate.cc ('K') | « src/isolate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698