OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/inferrer_constructor2_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__inferrer_constructor2_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_constructor2_test = Object.create(null); |
| 11 const compiler_annotations = Object.create(null); |
| 12 let VoidToint = () => (VoidToint = dart.constFn(dart.definiteFunctionType(core
.int, [])))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 15 let dynamicTobool = () => (dynamicTobool = dart.constFn(dart.definiteFunctionT
ype(core.bool, [dart.dynamic])))(); |
| 16 inferrer_constructor2_test.A = class A extends core.Object { |
| 17 new() { |
| 18 this.foo = null; |
| 19 this.bar = null; |
| 20 this.bar = dart.fn(() => 42, VoidToint()); |
| 21 this.foo = 54; |
| 22 } |
| 23 inline() { |
| 24 this.foo = null; |
| 25 this.bar = null; |
| 26 } |
| 27 }; |
| 28 dart.defineNamedConstructor(inferrer_constructor2_test.A, 'inline'); |
| 29 dart.setSignature(inferrer_constructor2_test.A, { |
| 30 constructors: () => ({ |
| 31 new: dart.definiteFunctionType(inferrer_constructor2_test.A, []), |
| 32 inline: dart.definiteFunctionType(inferrer_constructor2_test.A, []) |
| 33 }) |
| 34 }); |
| 35 inferrer_constructor2_test.main = function() { |
| 36 new inferrer_constructor2_test.A(); |
| 37 inferrer_constructor2_test.bar(); |
| 38 new inferrer_constructor2_test.A(); |
| 39 }; |
| 40 dart.fn(inferrer_constructor2_test.main, VoidTodynamic()); |
| 41 inferrer_constructor2_test.B = class B extends core.Object { |
| 42 new() { |
| 43 this.bar = null; |
| 44 this.closure = null; |
| 45 this.closure = dart.fn(() => 42, VoidToint()); |
| 46 this.bar = new inferrer_constructor2_test.A().foo; |
| 47 } |
| 48 }; |
| 49 dart.setSignature(inferrer_constructor2_test.B, { |
| 50 constructors: () => ({new: dart.definiteFunctionType(inferrer_constructor2_t
est.B, [])}) |
| 51 }); |
| 52 inferrer_constructor2_test.bar = function() { |
| 53 new inferrer_constructor2_test.B(); |
| 54 expect$.Expect.throws(dart.fn(() => dart.dsend(new inferrer_constructor2_tes
t.A.inline().foo, '+', 42), VoidTovoid()), dart.fn(e => core.NoSuchMethodError.i
s(e), dynamicTobool())); |
| 55 inferrer_constructor2_test.codegenLast(); |
| 56 new inferrer_constructor2_test.B(); |
| 57 }; |
| 58 dart.fn(inferrer_constructor2_test.bar, VoidTodynamic()); |
| 59 inferrer_constructor2_test.codegenLast = function() { |
| 60 new inferrer_constructor2_test.A().foo = new inferrer_constructor2_test.B().
bar; |
| 61 new inferrer_constructor2_test.B().closure = dart.fn(() => 42, VoidToint()); |
| 62 }; |
| 63 dart.fn(inferrer_constructor2_test.codegenLast, VoidTodynamic()); |
| 64 compiler_annotations.DontInline = class DontInline extends core.Object { |
| 65 new() { |
| 66 } |
| 67 }; |
| 68 dart.setSignature(compiler_annotations.DontInline, { |
| 69 constructors: () => ({new: dart.definiteFunctionType(compiler_annotations.Do
ntInline, [])}) |
| 70 }); |
| 71 // Exports: |
| 72 exports.inferrer_constructor2_test = inferrer_constructor2_test; |
| 73 exports.compiler_annotations = compiler_annotations; |
| 74 }); |
OLD | NEW |