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

Unified Diff: test/mjsunit/harmony/async-debug-caught-exception-cases.js

Issue 2351953002: Revert of Async/await Promise dependency graph (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/harmony/async-debug-caught-exception-cases.js
diff --git a/test/mjsunit/harmony/async-debug-caught-exception-cases.js b/test/mjsunit/harmony/async-debug-caught-exception-cases.js
index 7d7053d7a29d1e492b0c43824ef66e8f658b2c06..357bae35c21cbc13fd3a0233e52fb9bd5d606cb3 100644
--- a/test/mjsunit/harmony/async-debug-caught-exception-cases.js
+++ b/test/mjsunit/harmony/async-debug-caught-exception-cases.js
@@ -30,19 +30,6 @@
}
async function argThrower(x = (() => { throw "d"; })()) { } // Exception d
-
-async function awaitThrow() {
- await undefined;
- throw "e"; // Exception e
-}
-
-function constructorThrow() {
- return new Promise((resolve, reject) =>
- Promise.resolve().then(() =>
- reject("f") // Exception f
- )
- );
-}
function suppressThrow() {
return thrower();
@@ -93,43 +80,7 @@
}
}
-function switchCatch(producer) {
- let resolve;
- let promise = new Promise(r => resolve = r);
- async function localCaught() {
- try {
- await promise; // force switching to localUncaught and back
- await producer();
- } catch (e) { }
- }
- async function localUncaught() {
- await undefined;
- resolve();
- }
- localCaught();
- localUncaught();
-}
-
-function switchDotCatch(producer) {
- let resolve;
- let promise = new Promise(r => resolve = r);
- async function localCaught() {
- await promise; // force switching to localUncaught and back
- await producer();
- }
- async function localUncaught() {
- await undefined;
- resolve();
- }
- localCaught().catch(() => {});
- localUncaught();
-}
-
-let catches = [caught,
- indirectCaught,
- indirectAwaitCatch,
- switchCatch,
- switchDotCatch];
+let catches = [caught, indirectCaught, indirectAwaitCatch];
let noncatches = [uncaught, indirectUncaught];
let lateCatches = [dotCatch,
indirectReturnDotCatch,
@@ -138,19 +89,18 @@
let throws = [thrower, reject, argThrower, suppressThrow];
let nonthrows = [awaitReturn, scalar, nothing];
-let lateThrows = [awaitThrow, constructorThrow];
let uncatchable = [rejectConstructor];
let cases = [];
-for (let producer of throws.concat(lateThrows)) {
+for (let producer of throws) {
for (let consumer of catches) {
cases.push({ producer, consumer, expectedEvents: 1, caught: true });
cases.push({ producer, consumer, expectedEvents: 0, caught: false });
}
}
-for (let producer of throws.concat(lateThrows)) {
+for (let producer of throws) {
for (let consumer of noncatches) {
cases.push({ producer, consumer, expectedEvents: 1, caught: true });
cases.push({ producer, consumer, expectedEvents: 1, caught: false });
@@ -168,13 +118,6 @@
for (let consumer of catches.concat(noncatches, lateCatches)) {
cases.push({ producer, consumer, expectedEvents: 1, caught: true });
cases.push({ producer, consumer, expectedEvents: 1, caught: false });
- }
-}
-
-for (let producer of lateThrows) {
- for (let consumer of lateCatches) {
- cases.push({ producer, consumer, expectedEvents: 1, caught: true });
- cases.push({ producer, consumer, expectedEvents: 0, caught: false });
}
}
« no previous file with comments | « src/parsing/parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698