OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/inferrer_constructor_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__inferrer_constructor_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 inferrer_constructor_test = Object.create(null); |
| 11 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 12 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 inferrer_constructor_test.A = class A extends core.Object { |
| 15 new(test) { |
| 16 this.field = null; |
| 17 if (dart.test(test)) { |
| 18 return; |
| 19 this.field = 42; |
| 20 } else { |
| 21 this.field = 54; |
| 22 } |
| 23 } |
| 24 }; |
| 25 dart.setSignature(inferrer_constructor_test.A, { |
| 26 constructors: () => ({new: dart.definiteFunctionType(inferrer_constructor_te
st.A, [dart.dynamic])}) |
| 27 }); |
| 28 inferrer_constructor_test.main = function() { |
| 29 let a = new inferrer_constructor_test.A(true); |
| 30 expect$.Expect.throws(dart.fn(() => dart.dsend(a.field, '+', 42), VoidTovoid
()), dart.fn(e => core.NoSuchMethodError.is(e), dynamicTobool())); |
| 31 }; |
| 32 dart.fn(inferrer_constructor_test.main, VoidTodynamic()); |
| 33 // Exports: |
| 34 exports.inferrer_constructor_test = inferrer_constructor_test; |
| 35 }); |
OLD | NEW |