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

Unified Diff: tests/compiler/dart2js/async_await_js_transform_test.dart

Issue 2856223004: dart2js: Smaller async error sequence when only one handler (Closed)
Patch Set: comments Created 3 years, 7 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 | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/async_await_js_transform_test.dart
diff --git a/tests/compiler/dart2js/async_await_js_transform_test.dart b/tests/compiler/dart2js/async_await_js_transform_test.dart
index b84700a27d10b07c2d3987dfa2ee5630b1c2bfe9..4097d27a0f65433707ecdc9c031088ee354b3763 100644
--- a/tests/compiler/dart2js/async_await_js_transform_test.dart
+++ b/tests/compiler/dart2js/async_await_js_transform_test.dart
@@ -64,12 +64,10 @@ main() {
/// 01: ok
r"""function() {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError, closures, v0, v1, v2, v3;
+ var __goto = 0, __completer = NewCompleter(), closures, v0, v1, v2, v3;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -88,9 +86,6 @@ main() {
P.print(v0[v1].call$2(v2, v3));
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -107,12 +102,10 @@ function(a) async {
}""",
"""
function(a) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError, __self = this;
+ var __goto = 0, __completer = NewCompleter(), __self = this;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -124,9 +117,6 @@ function(a) {
// returning from await.
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -271,12 +261,10 @@ function(c) async {
}""",
"""
function(c) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError, a, b, c, d, e, f, __temp1;
+ var __goto = 0, __completer = NewCompleter(), a, b, c, d, e, f, __temp1;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -307,9 +295,6 @@ function(c) {
f = --__temp1[__result];
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -330,12 +315,10 @@ function(c) {
}""",
"""
function(d2) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError, a, b, c, d, e, f, g, h, __temp1;
+ var __goto = 0, __completer = NewCompleter(), a, b, c, d, e, f, g, h, __temp1;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -442,9 +425,6 @@ function(d2) {
h = foo1() && foo2();
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -469,12 +449,10 @@ function(x, y) async {
}""",
"""
function(x, y) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError;
+ var __goto = 0, __completer = NewCompleter();
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -538,9 +516,6 @@ function(x, y) {
// after while
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -560,12 +535,10 @@ function(x, y) {
""",
"""
function(f) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError, a;
+ var __goto = 0, __completer = NewCompleter(), a;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -601,9 +574,6 @@ function(f) {
// after do
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -627,12 +597,10 @@ function(g) async {
""",
"""
function(g) {
- var __goto = 0, __completer = NewCompleter(), __returnValue, __handler = 2, __currentError, i, __temp1;
+ var __goto = 0, __completer = NewCompleter(), __returnValue, i, __temp1;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -693,9 +661,6 @@ function(g) {
case 1:
// return
return returnHelper(__returnValue, __completer);
- case 2:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -714,12 +679,10 @@ function(g) {
""",
"""
function(a, h) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError, x, __temp1, __temp2;
+ var __goto = 0, __completer = NewCompleter(), x, __temp1, __temp2;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -770,9 +733,6 @@ function(a, h) {
__temp1[__temp2] = __result;
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -909,12 +869,10 @@ function(c, i) {
""",
"""
function(x, y, j) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError, __temp1, __temp2, __temp3;
+ var __goto = 0, __completer = NewCompleter(), __temp1, __temp2, __temp3;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -957,9 +915,6 @@ function(x, y, j) {
__temp1(__temp2(__temp3, __result, z));
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -994,12 +949,10 @@ function(x, y, k) async {
}""",
"""
function(x, y, k) {
- var __goto = 0, __completer = NewCompleter(), __returnValue, __handler = 2, __currentError, __temp1;
+ var __goto = 0, __completer = NewCompleter(), __returnValue, __temp1;
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -1099,9 +1052,6 @@ function(x, y, k) {
case 1:
// return
return returnHelper(__returnValue, __completer);
- case 2:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
@@ -1124,12 +1074,10 @@ function(x, y, k) {
}""",
"""
function(l) {
- var __goto = 0, __completer = NewCompleter(), __handler = 1, __currentError;
+ var __goto = 0, __completer = NewCompleter();
var body = _wrapJsFunctionForAsync(function(__errorCode, __result) {
- if (__errorCode === 1) {
- __currentError = __result;
- __goto = __handler;
- }
+ if (__errorCode === 1)
+ return rethrowHelper(__result, __completer);
while (true)
switch (__goto) {
case 0:
@@ -1150,9 +1098,6 @@ function(l) {
}
// implicit return
return returnHelper(null, __completer);
- case 1:
- // rethrow
- return rethrowHelper(__currentError, __completer);
}
});
return startHelper(body, __completer);
« no previous file with comments | « pkg/compiler/lib/src/js/rewrite_async.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698