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

Unified Diff: tests/language/function_test.dart

Issue 11377102: Remove named function literals from library and tests (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/language/function_syntax_test.dart ('k') | tests/language/function_type_alias6_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/function_test.dart
===================================================================
--- tests/language/function_test.dart (revision 14804)
+++ tests/language/function_test.dart (working copy)
@@ -65,7 +65,6 @@
static void testMain() {
var test = new FunctionTest();
- test.testRecursiveClosureRef();
test.testForEach();
test.testVarOrder1();
test.testVarOrder2();
@@ -74,7 +73,6 @@
test.testLexicalClosureRef3();
test.testLexicalClosureRef4();
test.testLexicalClosureRef5();
- test.testFunctionScopes();
test.testDefaultParametersOrder();
test.testParametersOrder();
test.testFunctionDefaults1();
@@ -216,25 +214,6 @@
int tempField;
- // Validate that a closure that calls the private name of a function (for
- // for recursion) calls the version of function with the bound names.
- void testRecursiveClosureRef() {
- tempField = 2;
- var x = 3;
- var g = f(a) {
- tempField++;
- x++;
- if (a > 0) {
- f(--a);
- }
- };
- g(2);
-
-
- Expect.equals(5, tempField);
- Expect.equals(6, x);
- }
-
void testForEach() {
List<int> vals = [1,2,3];
int total = 0;
@@ -244,33 +223,6 @@
Expect.equals(6, total);
}
- void testFunctionScopes() {
- // Function expression. 'recurse' is only defined within the function body.
- // FAILS:
- // var factorial0 = function recurse(int x) {
- // return (x == 1) ? 1 : (x * recurse(x - 1));
- // };
- // TEMP:
- var factorial0;
- factorial0 = recurse(int x) {
- return (x == 1) ? 1 : (x * factorial0(x - 1));
- };
- // END TEMP
-
-
- // Function statement. 'factorial1' is defined in the outer scope.
- int factorial1(int x) {
- return (x == 1) ? 1 : (x * factorial1(x - 1));
- }
-
- // This would fail to compile if 'recurse' were defined in the outer scope.
- // Which it shouldn't be.
- int recurse = 42;
-
- Expect.equals(6, factorial0(3));
- Expect.equals(24, factorial0(4));
- }
-
void testDefaultParametersOrder() {
f([a = 1, b = 3]) {
return a - b;
« no previous file with comments | « tests/language/function_syntax_test.dart ('k') | tests/language/function_type_alias6_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698