OLD | NEW |
1 var temps; | 1 var temps; |
2 (function(exports) { | 2 (function(exports) { |
3 'use strict'; | 3 'use strict'; |
4 let _x = Symbol('_x'); | 4 let _x = Symbol('_x'); |
5 let __x = Symbol('__x'); | 5 let __x = Symbol('__x'); |
6 let _function = Symbol('_function'); | 6 let _function = Symbol('_function'); |
7 class FormalCollision extends core.Object { | 7 class FormalCollision extends core.Object { |
8 FormalCollision(x, _x$, func) { | 8 FormalCollision(x, _x$, func) { |
9 this[_x] = x; | 9 this[_x] = x; |
10 this[__x] = _x$; | 10 this[__x] = _x$; |
11 this[_function] = func; | 11 this[_function] = func; |
12 } | 12 } |
13 } | 13 } |
| 14 let _opt = Symbol('_opt'); |
| 15 class OptionalArg extends core.Object { |
| 16 OptionalArg(opt) { |
| 17 if (opt === void 0) |
| 18 opt = 123; |
| 19 this[_opt] = opt; |
| 20 } |
| 21 named(opts) { |
| 22 let opt = opts && '_opt' in opts ? opts._opt : 456; |
| 23 this[_opt] = opt; |
| 24 } |
| 25 } |
| 26 dart.defineNamedConstructor(OptionalArg, 'named'); |
14 // Function main: () → dynamic | 27 // Function main: () → dynamic |
15 function main() { | 28 function main() { |
16 core.print(new FormalCollision(1, 2, x => x)); | 29 core.print(new FormalCollision(1, 2, x => x)); |
| 30 core.print(new OptionalArg()[_opt]); |
| 31 core.print(new OptionalArg.named()[_opt]); |
17 } | 32 } |
18 // Exports: | 33 // Exports: |
19 exports.FormalCollision = FormalCollision; | 34 exports.FormalCollision = FormalCollision; |
| 35 exports.OptionalArg = OptionalArg; |
20 exports.main = main; | 36 exports.main = main; |
21 })(temps || (temps = {})); | 37 })(temps || (temps = {})); |
OLD | NEW |