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

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

Issue 2964113004: Revert "Added for-loop variable tracking and regular closures/initializers captured variable tracki… (Closed)
Patch Set: Created 3 years, 6 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 | « tests/compiler/dart2js/closure/closure_test.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/forloop_box_test.dart
diff --git a/tests/compiler/dart2js/forloop_box_test.dart b/tests/compiler/dart2js/forloop_box_test.dart
index 3d5088258c64c96369a7b187cbd5d585770af676..e44bf61c537ebb6861dc53ea2b9e8aaef2fa59f1 100644
--- a/tests/compiler/dart2js/forloop_box_test.dart
+++ b/tests/compiler/dart2js/forloop_box_test.dart
@@ -6,7 +6,7 @@ import "package:expect/expect.dart";
import "package:async_helper/async_helper.dart";
import 'compiler_helper.dart';
-String SHOULD_NOT_BE_BOXED_TEST = r'''
+String TEST = r'''
main() {
var a;
for (var i=0; i<10; i++) {
@@ -16,7 +16,7 @@ main() {
}
''';
-String SHOULD_BE_BOXED_TEST = r'''
+String NEGATIVE_TEST = r'''
run(f) => f();
main() {
var a;
@@ -27,31 +27,13 @@ main() {
}
''';
-String ONLY_UPDATE_LOOP_VAR_TEST = r'''
-run(f) => f();
main() {
- var a;
- for (var i=0; i<10; run(() => i++)) {
- var b = 3;
- a = () => b = i;
- }
- print(a());
-}
-''';
-
-main() {
- asyncTest(() => compileAll(SHOULD_NOT_BE_BOXED_TEST).then((generated) {
+ asyncTest(() => compileAll(TEST).then((generated) {
Expect.isTrue(generated.contains('main_closure(i)'),
- 'for-loop variable should not have been boxed');
- }));
- asyncTest(() => compileAll(SHOULD_BE_BOXED_TEST).then((generated) {
- Expect.isFalse(generated.contains('main_closure(i)'),
- 'for-loop variable should have been boxed');
+ 'for-loop variable was boxed');
}));
- asyncTest(() => compileAll(ONLY_UPDATE_LOOP_VAR_TEST).then((generated) {
+ asyncTest(() => compileAll(NEGATIVE_TEST).then((generated) {
Expect.isFalse(generated.contains('main_closure(i)'),
'for-loop variable was not boxed');
- Expect.isFalse(generated.contains(', _box_0.b = 3,'),
- 'non for-loop captured variable should not be updated in loop');
}));
}
« no previous file with comments | « tests/compiler/dart2js/closure/closure_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698