OLD | NEW |
1 // compile options: --destructure-named-params | 1 // compile options: --destructure-named-params |
2 import 'dart-ext:foo'; | 2 import 'dart-ext:foo'; |
3 import 'package:js/src/varargs.dart'; | 3 import 'package:js/src/varargs.dart'; |
4 | 4 |
5 f(int a, b, [c = 1]) { | 5 f(int a, b, [c = 1]) { |
6 f(a, b, c); | 6 f(a, b, c); |
7 } | 7 } |
| 8 |
8 external f_ext(int a, b, [c = 1]); | 9 external f_ext(int a, b, [c = 1]); |
9 f_nat(int a, b, [c = 1]) native "f_nat"; | 10 f_nat(int a, b, [c = 1]) native "f_nat"; |
10 f_sync(int a, b, [c = 1]) sync* {} | 11 f_sync(int a, b, [c = 1]) sync* {} |
11 f_async(int a, b, [c = 1]) async* {} | 12 f_async(int a, b, [c = 1]) async* {} |
12 | 13 |
13 g(int a, b, {c : 1}) { | 14 g(int a, b, {c: 1}) { |
14 f(a, b, c); | 15 f(a, b, c); |
15 } | 16 } |
16 external g_ext(int a, b, {c : 1}); | 17 |
17 g_nat(int a, b, {c : 1}) native "g_nat"; | 18 external g_ext(int a, b, {c: 1}); |
18 g_sync(int a, b, {c : 1}) sync* {} | 19 g_nat(int a, b, {c: 1}) native "g_nat"; |
19 g_async(int a, b, {c : 1}) async* {} | 20 g_sync(int a, b, {c: 1}) sync* {} |
| 21 g_async(int a, b, {c: 1}) async* {} |
20 | 22 |
21 r(int a, @rest others) { | 23 r(int a, @rest others) { |
22 r(a, spread(others)); | 24 r(a, spread(others)); |
23 } | 25 } |
| 26 |
24 external r_ext(int a, @rest others); | 27 external r_ext(int a, @rest others); |
25 r_nat(int a, @rest others) native "r_nat"; | 28 r_nat(int a, @rest others) native "r_nat"; |
26 r_sync(int a, @rest others) sync* {} | 29 r_sync(int a, @rest others) sync* {} |
27 r_async(int a, @rest others) async* {} | 30 r_async(int a, @rest others) async* {} |
28 | 31 |
29 invalid_names1(int let, function, arguments) { | 32 invalid_names1(int let, function, arguments) { |
30 f(let, function, arguments); | 33 f(let, function, arguments); |
31 } | 34 } |
| 35 |
32 invalid_names2([int let, function = 1, arguments]) { | 36 invalid_names2([int let, function = 1, arguments]) { |
33 f(let, function, arguments); | 37 f(let, function, arguments); |
34 } | 38 } |
35 invalid_names3({int let, function, arguments : 2}) { | 39 |
| 40 invalid_names3({int let, function, arguments: 2}) { |
36 f(let, function, arguments); | 41 f(let, function, arguments); |
37 } | 42 } |
38 | 43 |
39 names_clashing_with_object_props({int constructor, valueOf, hasOwnProperty : 2})
{ | 44 names_clashing_with_object_props( |
| 45 {int constructor, valueOf, hasOwnProperty: 2}) { |
40 f(constructor, valueOf, hasOwnProperty); | 46 f(constructor, valueOf, hasOwnProperty); |
41 } | 47 } |
OLD | NEW |