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

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

Issue 1287253002: dart2js cps: Compile some loops as 'for' loops. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Update test expectations Created 5 years, 4 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
Index: tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
diff --git a/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
index 9020c71ad4f5c1d2cfb9a5b18689e66b7fbf59c1..f985f46e9e1487bf2af582caa501ccd1fd5dd834 100644
--- a/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
+++ b/tests/compiler/dart2js/js_backend_cps_ir_control_flow_test.dart
@@ -57,11 +57,10 @@ main() {
}""", """
function() {
var i = 0;
- while (V.foo(true) === true) {
+ for (; V.foo(true) === true; i = V.foo(i)) {
P.print(1);
if (V.foo(false) === true)
break;
- i = V.foo(i);
}
P.print(2);
}"""),
@@ -136,11 +135,10 @@ main() {
}""",r"""
function() {
var list = [1, 2, 3, 4, 5, 6], $length = list.length, i = 0;
- while (i < list.length) {
+ for (; i < list.length; i = i + 1) {
P.print(list[i]);
if ($length !== list.length)
H.throwConcurrentModificationError(list);
- i = i + 1;
}
}"""),
const TestEntry("""
@@ -158,7 +156,7 @@ function() {
H.throwConcurrentModificationError(xs);
i = 0;
i1 = 0;
- while (i < xs.length) {
+ for (; i < xs.length; i = i + 1, i1 = i1 + 1) {
current = xs[i];
if (length1 !== ys.length)
H.throwConcurrentModificationError(ys);
@@ -169,8 +167,6 @@ function() {
P.print(current1);
if ($length !== xs.length)
H.throwConcurrentModificationError(xs);
- i = i + 1;
- i1 = i1 + 1;
}
}"""),
];

Powered by Google App Engine
This is Rietveld 408576698