OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/closures_initializer2_test', null, /* Imports */[ |
| 2 'dart_sdk' |
| 3 ], function load__closures_initializer2_test(exports, dart_sdk) { |
| 4 'use strict'; |
| 5 const core = dart_sdk.core; |
| 6 const dart = dart_sdk.dart; |
| 7 const dartx = dart_sdk.dartx; |
| 8 const closures_initializer2_test = Object.create(null); |
| 9 let A = () => (A = dart.constFn(closures_initializer2_test.A$()))(); |
| 10 let AOfint = () => (AOfint = dart.constFn(closures_initializer2_test.A$(core.i
nt)))(); |
| 11 let VoidToType = () => (VoidToType = dart.constFn(dart.definiteFunctionType(co
re.Type, [])))(); |
| 12 let dynamicAnddynamicTodynamic = () => (dynamicAnddynamicTodynamic = dart.cons
tFn(dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic])))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 closures_initializer2_test.A$ = dart.generic(T => { |
| 15 class A extends core.Object { |
| 16 new() { |
| 17 this.t = dart.fn(() => dart.wrapType(T), VoidToType()); |
| 18 } |
| 19 } |
| 20 dart.addTypeTests(A); |
| 21 dart.setSignature(A, { |
| 22 constructors: () => ({new: dart.definiteFunctionType(closures_initializer2
_test.A$(T), [])}) |
| 23 }); |
| 24 return A; |
| 25 }); |
| 26 closures_initializer2_test.A = A(); |
| 27 closures_initializer2_test.expect = function(result, expected) { |
| 28 if (!dart.equals(result, expected)) { |
| 29 dart.throw(dart.str`Expected ${expected}, got ${result}`); |
| 30 } |
| 31 }; |
| 32 dart.fn(closures_initializer2_test.expect, dynamicAnddynamicTodynamic()); |
| 33 closures_initializer2_test.main = function() { |
| 34 for (let i = 0; i < dart.notNull(core.int.parse("1")); i++) { |
| 35 closures_initializer2_test.expect(core.Type.is(dart.dsend(new (AOfint())()
, 't')), true); |
| 36 } |
| 37 }; |
| 38 dart.fn(closures_initializer2_test.main, VoidTodynamic()); |
| 39 // Exports: |
| 40 exports.closures_initializer2_test = closures_initializer2_test; |
| 41 }); |
OLD | NEW |