OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/closure_side_effect_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__closure_side_effect_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const _interceptors = dart_sdk._interceptors; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const expect$ = expect.expect; |
| 11 const closure_side_effect_test = Object.create(null); |
| 12 let JSArrayOfC = () => (JSArrayOfC = dart.constFn(_interceptors.JSArray$(closu
re_side_effect_test.C)))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 closure_side_effect_test.b = null; |
| 15 dart.defineLazy(closure_side_effect_test, { |
| 16 get a() { |
| 17 return dart.fn(() => { |
| 18 closure_side_effect_test.b = 42; |
| 19 }, VoidTodynamic()); |
| 20 }, |
| 21 set a(_) {} |
| 22 }); |
| 23 dart.defineLazy(closure_side_effect_test, { |
| 24 get c() { |
| 25 return JSArrayOfC().of([new closure_side_effect_test.C()]); |
| 26 }, |
| 27 set c(_) {} |
| 28 }); |
| 29 closure_side_effect_test.C = class C extends core.Object { |
| 30 nonInlinable1() { |
| 31 closure_side_effect_test.a(); |
| 32 } |
| 33 nonInlinable2() { |
| 34 let a = dart.fn(() => { |
| 35 closure_side_effect_test.b = 42; |
| 36 }, VoidTodynamic()); |
| 37 a(); |
| 38 } |
| 39 }; |
| 40 dart.setSignature(closure_side_effect_test.C, { |
| 41 methods: () => ({ |
| 42 nonInlinable1: dart.definiteFunctionType(dart.dynamic, []), |
| 43 nonInlinable2: dart.definiteFunctionType(dart.dynamic, []) |
| 44 }) |
| 45 }); |
| 46 closure_side_effect_test.testClosureInStaticField = function() { |
| 47 let temp = closure_side_effect_test.c[dartx.get](0); |
| 48 expect$.Expect.isNull(closure_side_effect_test.b); |
| 49 temp.nonInlinable1(); |
| 50 expect$.Expect.equals(42, closure_side_effect_test.b); |
| 51 closure_side_effect_test.b = null; |
| 52 }; |
| 53 dart.fn(closure_side_effect_test.testClosureInStaticField, VoidTodynamic()); |
| 54 closure_side_effect_test.testLocalClosure = function() { |
| 55 let temp = closure_side_effect_test.c[dartx.get](0); |
| 56 expect$.Expect.isNull(closure_side_effect_test.b); |
| 57 temp.nonInlinable2(); |
| 58 expect$.Expect.equals(42, closure_side_effect_test.b); |
| 59 }; |
| 60 dart.fn(closure_side_effect_test.testLocalClosure, VoidTodynamic()); |
| 61 closure_side_effect_test.main = function() { |
| 62 closure_side_effect_test.testClosureInStaticField(); |
| 63 closure_side_effect_test.testLocalClosure(); |
| 64 }; |
| 65 dart.fn(closure_side_effect_test.main, VoidTodynamic()); |
| 66 // Exports: |
| 67 exports.closure_side_effect_test = closure_side_effect_test; |
| 68 }); |
OLD | NEW |