OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/inferrer_constructor4_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__inferrer_constructor4_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_constructor4_test = Object.create(null); |
| 11 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 12 let VoidToB = () => (VoidToB = dart.constFn(dart.definiteFunctionType(inferrer
_constructor4_test.B, [])))(); |
| 13 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 14 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 15 inferrer_constructor4_test.escape = function(object) { |
| 16 core.print(dart.dsend(dart.dload(object, 'field'), '+', 42)); |
| 17 }; |
| 18 dart.fn(inferrer_constructor4_test.escape, dynamicTodynamic()); |
| 19 inferrer_constructor4_test.A = class A extends core.Object { |
| 20 new() { |
| 21 inferrer_constructor4_test.escape(this); |
| 22 } |
| 23 }; |
| 24 dart.setSignature(inferrer_constructor4_test.A, { |
| 25 constructors: () => ({new: dart.definiteFunctionType(inferrer_constructor4_t
est.A, [])}) |
| 26 }); |
| 27 inferrer_constructor4_test.B = class B extends inferrer_constructor4_test.A { |
| 28 new() { |
| 29 this.field = null; |
| 30 super.new(); |
| 31 this.field = 42; |
| 32 } |
| 33 }; |
| 34 dart.setSignature(inferrer_constructor4_test.B, { |
| 35 constructors: () => ({new: dart.definiteFunctionType(inferrer_constructor4_t
est.B, [])}) |
| 36 }); |
| 37 inferrer_constructor4_test.main = function() { |
| 38 expect$.Expect.throws(dart.fn(() => new inferrer_constructor4_test.B(), Void
ToB()), dart.fn(e => core.NoSuchMethodError.is(e), dynamicTobool())); |
| 39 }; |
| 40 dart.fn(inferrer_constructor4_test.main, VoidTodynamic()); |
| 41 // Exports: |
| 42 exports.inferrer_constructor4_test = inferrer_constructor4_test; |
| 43 }); |
OLD | NEW |