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

Unified Diff: pkg/kernel/testcases/closures/for_in_closure.dart

Issue 3000333002: Fix several bugs in closure conversion. (Closed)
Patch Set: Comments. Created 3 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: pkg/kernel/testcases/closures/for_in_closure.dart
diff --git a/pkg/kernel/testcases/closures/for_in_closure.dart b/pkg/kernel/testcases/closures/for_in_closure.dart
index b48b18572797cc8ebf787754e8206dded67dbcf3..7dab558d62711e6254967398e0da9f3aee9826b9 100644
--- a/pkg/kernel/testcases/closures/for_in_closure.dart
+++ b/pkg/kernel/testcases/closures/for_in_closure.dart
@@ -6,8 +6,9 @@ const numbers = const <int>[0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
main() {
var closures = [];
+ var captured_outside = 0;
for (int i in numbers) {
- closures.add(() => i);
+ closures.add(() => i + captured_outside);
}
int sum = 0;
for (Function f in closures) {
« no previous file with comments | « pkg/kernel/testcases/closures/blocks.dart.expect ('k') | pkg/kernel/testcases/closures/for_in_closure.dart.expect » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698