Index: test/mjsunit/harmony/async-debug-caught-exception.js |
diff --git a/test/mjsunit/harmony/async-debug-caught-exception.js b/test/mjsunit/harmony/async-debug-caught-exception.js |
index b2ceeb99589c4128e2f8182d0f5a0a0ab83d0683..047b421d3d8d105abbbf9f7f01332dd16b6d18b2 100644 |
--- a/test/mjsunit/harmony/async-debug-caught-exception.js |
+++ b/test/mjsunit/harmony/async-debug-caught-exception.js |
@@ -121,3 +121,24 @@ assertNull(exception); |
Debug.clearBreakOnUncaughtException(); |
Debug.setListener(null); |
+ |
+// If devtools is turned on in the middle, then catch prediction |
+// could be wrong (here, it mispredicts the exception as caught), |
+// but shouldn't crash. |
+ |
+log = []; |
+ |
+var resolve; |
+var turnOnListenerPromise = new Promise(r => resolve = r); |
+async function confused() { |
+ await turnOnListenerPromise; |
+ throw foo |
+} |
+confused(); |
+Promise.resolve().then(() => { |
+ Debug.setListener(listener); |
+ Debug.setBreakOnUncaughtException(); |
+ resolve(); |
+}); |
+ |
+assertEquals([], log); |