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

Unified Diff: tests/compiler/dart2js_extra/closure_capture_test.dart

Issue 437193002: Remove function names on function expressions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove TODO Created 6 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_extra/closure_capture_test.dart
diff --git a/tests/compiler/dart2js_extra/closure_capture_test.dart b/tests/compiler/dart2js_extra/closure_capture_test.dart
index f76b024bd3503124d4592144d37d444c2aa5d8d2..c55317bb30f696ad62a5cc0f4c29993e2dda6019 100644
--- a/tests/compiler/dart2js_extra/closure_capture_test.dart
+++ b/tests/compiler/dart2js_extra/closure_capture_test.dart
@@ -6,15 +6,14 @@ import "package:expect/expect.dart";
closure0() {
var x = 499;
- // TODO(floitsch): remove name from functions.
- var f = fun() { return x; };
+ var f = () { return x; };
Expect.equals(499, f());
}
class A {
closure1() {
var x = 499;
- var f = fun() { return x; };
+ var f = () { return x; };
Expect.equals(499, f());
}
}
@@ -25,12 +24,12 @@ applyFun(f) {
closure2() {
var x = 499;
- Expect.equals(499, applyFun(fun() { return x; }));
+ Expect.equals(499, applyFun(() { return x; }));
}
closure3() {
var y = 400;
- var f = fun(x) { return y + x; };
+ var f = (x) { return y + x; };
Expect.equals(499, f(99));
}
@@ -40,13 +39,12 @@ applyFun2(f) {
closure4() {
var z = 9;
- Expect.equals(499, applyFun2(fun(x, y) { return x + y + z; }));
+ Expect.equals(499, applyFun2((x, y) { return x + y + z; }));
}
closure5() {
var x = 498;
- // TODO(floitsch): remove name from functions.
- var f = fun() { return x; };
+ var f = () { return x; };
x++;
Expect.equals(499, f());
}
@@ -54,7 +52,7 @@ closure5() {
class A2 {
closure6() {
var x = 498;
- var f = fun() { return x; };
+ var f = () { return x; };
x++;
Expect.equals(499, f());
}
@@ -62,21 +60,21 @@ class A2 {
closure7() {
var x = 498;
- var f = fun() { return x; };
+ var f = () { return x; };
x++;
Expect.equals(499, applyFun(f));
}
closure8() {
var y = 399;
- var f = fun(x) { return y + x; };
+ var f = (x) { return y + x; };
y++;
Expect.equals(499, f(99));
}
closure9() {
var z = 9;
- Expect.equals(499, applyFun2(fun(x, y) { return x + y + z; }));
+ Expect.equals(499, applyFun2((x, y) { return x + y + z; }));
}
main() {
« no previous file with comments | « tests/compiler/dart2js_extra/closure_capture5_test.dart ('k') | tests/compiler/dart2js_extra/closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698