OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/generic_instanceof2_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__generic_instanceof2_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 generic_instanceof2_test = Object.create(null); |
| 11 let Foo = () => (Foo = dart.constFn(generic_instanceof2_test.Foo$()))(); |
| 12 let Moo = () => (Moo = dart.constFn(generic_instanceof2_test.Moo$()))(); |
| 13 let FooOfint$num = () => (FooOfint$num = dart.constFn(generic_instanceof2_test
.Foo$(core.int, core.num)))(); |
| 14 let FooOfint$String = () => (FooOfint$String = dart.constFn(generic_instanceof
2_test.Foo$(core.int, core.String)))(); |
| 15 let MooOfint$num = () => (MooOfint$num = dart.constFn(generic_instanceof2_test
.Moo$(core.int, core.num)))(); |
| 16 let MooOfint$String = () => (MooOfint$String = dart.constFn(generic_instanceof
2_test.Moo$(core.int, core.String)))(); |
| 17 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 18 generic_instanceof2_test.Foo$ = dart.generic((K, V) => { |
| 19 let FooOfK$V = () => (FooOfK$V = dart.constFn(generic_instanceof2_test.Foo$(
K, V)))(); |
| 20 let FooOfK$String = () => (FooOfK$String = dart.constFn(generic_instanceof2_
test.Foo$(K, core.String)))(); |
| 21 class Foo extends core.Object { |
| 22 new() { |
| 23 } |
| 24 static fac() { |
| 25 return new (FooOfK$V())(); |
| 26 } |
| 27 FooString() { |
| 28 return FooOfK$String().fac(); |
| 29 } |
| 30 } |
| 31 dart.addTypeTests(Foo); |
| 32 dart.setSignature(Foo, { |
| 33 constructors: () => ({ |
| 34 new: dart.definiteFunctionType(generic_instanceof2_test.Foo$(K, V), []), |
| 35 fac: dart.definiteFunctionType(generic_instanceof2_test.Foo$(K, V), []) |
| 36 }), |
| 37 methods: () => ({FooString: dart.definiteFunctionType(dart.dynamic, [])}) |
| 38 }); |
| 39 return Foo; |
| 40 }); |
| 41 generic_instanceof2_test.Foo = Foo(); |
| 42 generic_instanceof2_test.Moo$ = dart.generic((K, V) => { |
| 43 let MooOfK$String = () => (MooOfK$String = dart.constFn(generic_instanceof2_
test.Moo$(K, core.String)))(); |
| 44 class Moo extends core.Object { |
| 45 new() { |
| 46 } |
| 47 MooString() { |
| 48 return new (MooOfK$String())(); |
| 49 } |
| 50 } |
| 51 dart.addTypeTests(Moo); |
| 52 dart.setSignature(Moo, { |
| 53 constructors: () => ({new: dart.definiteFunctionType(generic_instanceof2_t
est.Moo$(K, V), [])}), |
| 54 methods: () => ({MooString: dart.definiteFunctionType(dart.dynamic, [])}) |
| 55 }); |
| 56 return Moo; |
| 57 }); |
| 58 generic_instanceof2_test.Moo = Moo(); |
| 59 generic_instanceof2_test.testAll = function() { |
| 60 let foo_int_num = new (FooOfint$num())(); |
| 61 expect$.Expect.isTrue(FooOfint$num().is(foo_int_num)); |
| 62 expect$.Expect.isTrue(!FooOfint$String().is(foo_int_num)); |
| 63 expect$.Expect.isTrue(!FooOfint$num().is(foo_int_num.FooString())); |
| 64 expect$.Expect.isTrue(FooOfint$String().is(foo_int_num.FooString())); |
| 65 let foo_raw = new generic_instanceof2_test.Foo(); |
| 66 expect$.Expect.isTrue(FooOfint$num().is(foo_raw)); |
| 67 expect$.Expect.isTrue(FooOfint$String().is(foo_raw)); |
| 68 expect$.Expect.isTrue(!FooOfint$num().is(foo_raw.FooString())); |
| 69 expect$.Expect.isTrue(FooOfint$String().is(foo_raw.FooString())); |
| 70 let moo_int_num = new (MooOfint$num())(); |
| 71 expect$.Expect.isTrue(MooOfint$num().is(moo_int_num)); |
| 72 expect$.Expect.isTrue(!MooOfint$String().is(moo_int_num)); |
| 73 expect$.Expect.isTrue(!MooOfint$num().is(moo_int_num.MooString())); |
| 74 expect$.Expect.isTrue(MooOfint$String().is(moo_int_num.MooString())); |
| 75 let moo_raw = new generic_instanceof2_test.Moo(); |
| 76 expect$.Expect.isTrue(MooOfint$num().is(moo_raw)); |
| 77 expect$.Expect.isTrue(MooOfint$String().is(moo_raw)); |
| 78 expect$.Expect.isTrue(!MooOfint$num().is(moo_raw.MooString())); |
| 79 expect$.Expect.isTrue(MooOfint$String().is(moo_raw.MooString())); |
| 80 }; |
| 81 dart.fn(generic_instanceof2_test.testAll, VoidTodynamic()); |
| 82 generic_instanceof2_test.main = function() { |
| 83 for (let i = 0; i < 5; i++) { |
| 84 generic_instanceof2_test.testAll(); |
| 85 } |
| 86 }; |
| 87 dart.fn(generic_instanceof2_test.main, VoidTodynamic()); |
| 88 // Exports: |
| 89 exports.generic_instanceof2_test = generic_instanceof2_test; |
| 90 }); |
OLD | NEW |