OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/compile_time_constant_f_test', null, /* Imports *
/[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__compile_time_constant_f_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const expect$ = expect.expect; |
| 10 const compile_time_constant_f_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 compile_time_constant_f_test.A = class A extends core.Object { |
| 13 new(x) { |
| 14 this.x = x; |
| 15 } |
| 16 named(x) { |
| 17 if (x === void 0) x = null; |
| 18 this.x = x; |
| 19 } |
| 20 named2(x) { |
| 21 if (x === void 0) x = 2; |
| 22 this.x = x; |
| 23 } |
| 24 }; |
| 25 dart.defineNamedConstructor(compile_time_constant_f_test.A, 'named'); |
| 26 dart.defineNamedConstructor(compile_time_constant_f_test.A, 'named2'); |
| 27 dart.setSignature(compile_time_constant_f_test.A, { |
| 28 constructors: () => ({ |
| 29 new: dart.definiteFunctionType(compile_time_constant_f_test.A, [dart.dynam
ic]), |
| 30 named: dart.definiteFunctionType(compile_time_constant_f_test.A, [], [dart
.dynamic]), |
| 31 named2: dart.definiteFunctionType(compile_time_constant_f_test.A, [], [dar
t.dynamic]) |
| 32 }) |
| 33 }); |
| 34 compile_time_constant_f_test.a1 = dart.const(new compile_time_constant_f_test.
A(0)); |
| 35 compile_time_constant_f_test.a2 = dart.const(new compile_time_constant_f_test.
A.named()); |
| 36 compile_time_constant_f_test.a3 = dart.const(new compile_time_constant_f_test.
A.named(1)); |
| 37 compile_time_constant_f_test.a4 = dart.const(new compile_time_constant_f_test.
A.named2()); |
| 38 compile_time_constant_f_test.a5 = dart.const(new compile_time_constant_f_test.
A.named2(3)); |
| 39 compile_time_constant_f_test.main = function() { |
| 40 expect$.Expect.equals(0, compile_time_constant_f_test.a1.x); |
| 41 expect$.Expect.equals(null, compile_time_constant_f_test.a2.x); |
| 42 expect$.Expect.equals(1, compile_time_constant_f_test.a3.x); |
| 43 expect$.Expect.equals(2, compile_time_constant_f_test.a4.x); |
| 44 expect$.Expect.equals(3, compile_time_constant_f_test.a5.x); |
| 45 }; |
| 46 dart.fn(compile_time_constant_f_test.main, VoidTodynamic()); |
| 47 // Exports: |
| 48 exports.compile_time_constant_f_test = compile_time_constant_f_test; |
| 49 }); |
OLD | NEW |