OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/closure_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__closure_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 closure_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 closure_test.A = class A extends core.Object { |
| 13 new(field) { |
| 14 this.field = field; |
| 15 } |
| 16 }; |
| 17 dart.setSignature(closure_test.A, { |
| 18 constructors: () => ({new: dart.definiteFunctionType(closure_test.A, [dart.d
ynamic])}) |
| 19 }); |
| 20 closure_test.ClosureTest = class ClosureTest extends core.Object { |
| 21 static testMain() { |
| 22 let o = new closure_test.A(3); |
| 23 function foo() { |
| 24 return (() => { |
| 25 let x = o.field; |
| 26 o.field = dart.dsend(x, '+', 1); |
| 27 return x; |
| 28 })(); |
| 29 } |
| 30 dart.fn(foo, VoidTodynamic()); |
| 31 expect$.Expect.equals(3, foo()); |
| 32 expect$.Expect.equals(4, o.field); |
| 33 } |
| 34 }; |
| 35 dart.setSignature(closure_test.ClosureTest, { |
| 36 statics: () => ({testMain: dart.definiteFunctionType(dart.dynamic, [])}), |
| 37 names: ['testMain'] |
| 38 }); |
| 39 closure_test.main = function() { |
| 40 closure_test.ClosureTest.testMain(); |
| 41 }; |
| 42 dart.fn(closure_test.main, VoidTodynamic()); |
| 43 // Exports: |
| 44 exports.closure_test = closure_test; |
| 45 }); |
OLD | NEW |