| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | |
| 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. | |
| 4 // Test that parameters keep their names in the output. | |
| 5 | |
| 6 import 'package:async_helper/async_helper.dart'; | |
| 7 import 'package:expect/expect.dart'; | |
| 8 import 'compiler_helper.dart'; | |
| 9 | |
| 10 main() { | |
| 11 // If a function call has trailing 'null' arguments, we can safely skip | |
| 12 // them as JavaScript will fill missing arguments with 'undefined'. | |
| 13 asyncTest(() => compile(r""" | |
| 14 class It<A, B> { | |
| 15 It([a, b, c]) : super; | |
| 16 } | |
| 17 | |
| 18 foo(a,b,c) => a; | |
| 19 test() { | |
| 20 foo(1, null, null); | |
| 21 foo(2, 3, null); | |
| 22 new It(); | |
| 23 new It(null, 1); | |
| 24 } | |
| 25 """, | |
| 26 entry: 'test', minify: false).then((String generated) { | |
| 27 Expect.isTrue(generated.contains(r"foo(1)")); | |
| 28 Expect.isTrue(generated.contains(r"foo(2, 3)")); | |
| 29 Expect.isTrue(generated.contains(r"It$()")); | |
| 30 Expect.isTrue(generated.contains(r"It$(null, 1)")); | |
| 31 })); | |
| 32 } | |
| OLD | NEW |