OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/generic_native_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__generic_native_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_native_test = Object.create(null); |
| 11 let A = () => (A = dart.constFn(generic_native_test.A$()))(); |
| 12 let ListOfB = () => (ListOfB = dart.constFn(core.List$(generic_native_test.B))
)(); |
| 13 let IterableOfB = () => (IterableOfB = dart.constFn(core.Iterable$(generic_nat
ive_test.B)))(); |
| 14 let AOfIterableOfB = () => (AOfIterableOfB = dart.constFn(generic_native_test.
A$(IterableOfB())))(); |
| 15 let IterableOfC = () => (IterableOfC = dart.constFn(core.Iterable$(generic_nat
ive_test.C)))(); |
| 16 let AOfIterableOfC = () => (AOfIterableOfC = dart.constFn(generic_native_test.
A$(IterableOfC())))(); |
| 17 let AOfPattern = () => (AOfPattern = dart.constFn(generic_native_test.A$(core.
Pattern)))(); |
| 18 let ComparableOfString = () => (ComparableOfString = dart.constFn(core.Compara
ble$(core.String)))(); |
| 19 let AOfComparableOfString = () => (AOfComparableOfString = dart.constFn(generi
c_native_test.A$(ComparableOfString())))(); |
| 20 let ComparableOfC = () => (ComparableOfC = dart.constFn(core.Comparable$(gener
ic_native_test.C)))(); |
| 21 let AOfComparableOfC = () => (AOfComparableOfC = dart.constFn(generic_native_t
est.A$(ComparableOfC())))(); |
| 22 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 23 generic_native_test.A$ = dart.generic(T => { |
| 24 class A extends core.Object { |
| 25 foo(o) { |
| 26 return T.is(o); |
| 27 } |
| 28 } |
| 29 dart.addTypeTests(A); |
| 30 dart.setSignature(A, { |
| 31 methods: () => ({foo: dart.definiteFunctionType(dart.dynamic, [dart.dynami
c])}) |
| 32 }); |
| 33 return A; |
| 34 }); |
| 35 generic_native_test.A = A(); |
| 36 generic_native_test.B = class B extends core.Object {}; |
| 37 generic_native_test.C = class C extends core.Object {}; |
| 38 generic_native_test.main = function() { |
| 39 expect$.Expect.isTrue(new (AOfIterableOfB())().foo(ListOfB().new())); |
| 40 expect$.Expect.isFalse(new (AOfIterableOfC())().foo(ListOfB().new())); |
| 41 expect$.Expect.isTrue(new (AOfPattern())().foo('hest')); |
| 42 expect$.Expect.isTrue(new (AOfComparableOfString())().foo('hest')); |
| 43 expect$.Expect.isFalse(new (AOfComparableOfC())().foo('hest')); |
| 44 }; |
| 45 dart.fn(generic_native_test.main, VoidTodynamic()); |
| 46 // Exports: |
| 47 exports.generic_native_test = generic_native_test; |
| 48 }); |
OLD | NEW |