OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/closure_cycles_test', null, /* Imports */[ |
| 2 'dart_sdk' |
| 3 ], function load__closure_cycles_test(exports, dart_sdk) { |
| 4 'use strict'; |
| 5 const core = dart_sdk.core; |
| 6 const async = dart_sdk.async; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const closure_cycles_test = Object.create(null); |
| 10 let VoidTovoid = () => (VoidTovoid = dart.constFn(dart.definiteFunctionType(da
rt.void, [])))(); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 let dynamicTodynamic = () => (dynamicTodynamic = dart.constFn(dart.definiteFun
ctionType(dart.dynamic, [dart.dynamic])))(); |
| 13 closure_cycles_test.X = class X extends core.Object { |
| 14 new() { |
| 15 this.onX = null; |
| 16 async.Timer.run(dart.fn(() => dart.dcall(this.onX, new closure_cycles_test
.Y()), VoidTovoid())); |
| 17 } |
| 18 }; |
| 19 dart.setSignature(closure_cycles_test.X, { |
| 20 constructors: () => ({new: dart.definiteFunctionType(closure_cycles_test.X,
[])}) |
| 21 }); |
| 22 closure_cycles_test.Y = class Y extends core.Object { |
| 23 new() { |
| 24 this.onY = null; |
| 25 this.heavyMemory = null; |
| 26 this.heavyMemory = core.List.new(10 * 1024 * 1024); |
| 27 if ((() => { |
| 28 let x = closure_cycles_test.Y.count; |
| 29 closure_cycles_test.Y.count = dart.notNull(x) + 1; |
| 30 return x; |
| 31 })() > 100) return; |
| 32 async.Timer.run(dart.fn(() => dart.dcall(this.onY), VoidTovoid())); |
| 33 } |
| 34 }; |
| 35 dart.setSignature(closure_cycles_test.Y, { |
| 36 constructors: () => ({new: dart.definiteFunctionType(closure_cycles_test.Y,
[])}) |
| 37 }); |
| 38 closure_cycles_test.Y.count = 0; |
| 39 closure_cycles_test.doIt = function() { |
| 40 let x = new closure_cycles_test.X(); |
| 41 x.onX = dart.fn(y => { |
| 42 dart.dput(y, 'onY', dart.fn(() => { |
| 43 y; |
| 44 closure_cycles_test.doIt(); |
| 45 }, VoidTodynamic())); |
| 46 }, dynamicTodynamic()); |
| 47 }; |
| 48 dart.fn(closure_cycles_test.doIt, VoidTovoid()); |
| 49 closure_cycles_test.main = function() { |
| 50 closure_cycles_test.doIt(); |
| 51 }; |
| 52 dart.fn(closure_cycles_test.main, VoidTovoid()); |
| 53 // Exports: |
| 54 exports.closure_cycles_test = closure_cycles_test; |
| 55 }); |
OLD | NEW |