Chromium Code Reviews| Index: tests/language/call_operator_test.dart |
| diff --git a/tests/language/call_operator_test.dart b/tests/language/call_operator_test.dart |
| index b89c8bcf8a234c4485d9c32a78b67b29704a885c..d03ece0bfdca44a93f05ac42ac9fc990ef92e4f2 100644 |
| --- a/tests/language/call_operator_test.dart |
| +++ b/tests/language/call_operator_test.dart |
| @@ -5,36 +5,36 @@ |
| // simple test with no types in signature |
| class A1 { |
| - operator call() => 42; |
| + call() => 42; |
| } |
| // same test, include return type |
| class A2 { |
| - int operator call() => 35; |
| + int call() => 35; |
| } |
| class B { |
| - call() => 28; // expect warning, should use 'operator call' |
| + call() => 28; |
| } |
| // A call() operator can have any arity |
| class C { |
| - operator call(arg) => 7 * arg; |
| + call(arg) => 7 * arg; |
| } |
| // Test named arguments |
| class D { |
| - operator call([arg=6]) => 7 * arg; |
| + call([arg=6]) => 7 * arg; |
| } |
| -// non-trvial method body combination of positional and named |
| +// non-trivial method body combination of positional and named |
| class E { |
| - String operator call(String str, [int count=1]) { |
| + String call(String str, [int count=1]) { |
| String result = ""; |
|
kasperl
2012/08/10 10:16:28
How about using a StringBuffer here? Seems cleaner
floitsch
2012/08/10 12:19:16
Done.
|
| for (var i = 0; i < count; i++) { |
| - result += str; |
| + result = "$result$str"; |
| if (i < count -1) { |
|
kasperl
2012/08/10 10:16:28
-1 => - 1
floitsch
2012/08/10 12:19:16
Done.
|
| - result += ':'; |
| + result = '$result:'; |
| } |
| } |
| return result; |