| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 // Test that parameters keep their names in the output. | 4 // Test that parameters keep their names in the output. |
| 5 | 5 |
| 6 import 'dart:async'; | 6 import 'dart:async'; |
| 7 import 'package:expect/expect.dart'; | 7 import 'package:expect/expect.dart'; |
| 8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
| 9 import 'compiler_helper.dart'; | 9 import 'compiler_helper.dart'; |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 main() { | 26 main() { |
| 27 var o = null; | 27 var o = null; |
| 28 o(1, 2); | 28 o(1, 2); |
| 29 } | 29 } |
| 30 """; | 30 """; |
| 31 | 31 |
| 32 const String TEST_BAILOUT = r""" | 32 const String TEST_BAILOUT = r""" |
| 33 class A { | 33 class A { |
| 34 var x; | 34 var x; |
| 35 foo(_) { // make sure only g has no arguments | 35 foo(_) { // make sure only g has no arguments |
| 36 var f = function g() { return 499; }; | 36 var f = () { return 499; }; |
| 37 return 499 + x + f(); | 37 return 499 + x + f(); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 | 40 |
| 41 main() { new A().foo(1); } | 41 main() { new A().foo(1); } |
| 42 """; | 42 """; |
| 43 | 43 |
| 44 Future closureInvocation(bool minify, String prefix) { | 44 Future closureInvocation(bool minify, String prefix) { |
| 45 return Future.wait([ | 45 return Future.wait([ |
| 46 compile(TEST_INVOCATION0, minify: minify, check: (String generated) { | 46 compile(TEST_INVOCATION0, minify: minify, check: (String generated) { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 66 } | 66 } |
| 67 | 67 |
| 68 main() { | 68 main() { |
| 69 asyncTest(() => Future.wait([ | 69 asyncTest(() => Future.wait([ |
| 70 closureInvocation(false, "call"), | 70 closureInvocation(false, "call"), |
| 71 closureInvocation(true, ""), | 71 closureInvocation(true, ""), |
| 72 closureBailout(false, "call"), | 72 closureBailout(false, "call"), |
| 73 closureBailout(true, ""), | 73 closureBailout(true, ""), |
| 74 ])); | 74 ])); |
| 75 } | 75 } |
| OLD | NEW |