OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/const_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__const_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 const_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 const_test.AConst = class AConst extends core.Object { |
| 13 new() { |
| 14 this.b_ = 3; |
| 15 } |
| 16 }; |
| 17 dart.setSignature(const_test.AConst, { |
| 18 constructors: () => ({new: dart.definiteFunctionType(const_test.AConst, [])}
) |
| 19 }); |
| 20 const_test.BConst = class BConst extends core.Object { |
| 21 new() { |
| 22 } |
| 23 set foo(value) {} |
| 24 get foo() { |
| 25 return 5; |
| 26 } |
| 27 get(ix) { |
| 28 return ix; |
| 29 } |
| 30 set(ix, value) { |
| 31 return value; |
| 32 } |
| 33 }; |
| 34 dart.setSignature(const_test.BConst, { |
| 35 constructors: () => ({new: dart.definiteFunctionType(const_test.BConst, [])}
), |
| 36 methods: () => ({ |
| 37 get: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]), |
| 38 set: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic]) |
| 39 }) |
| 40 }); |
| 41 let const$; |
| 42 let const$0; |
| 43 let const$1; |
| 44 const_test.testMain = function() { |
| 45 let o = const$ || (const$ = dart.const(new const_test.AConst())); |
| 46 expect$.Expect.equals(3, o.b_); |
| 47 let o$ = const$0 || (const$0 = dart.const(new const_test.BConst())); |
| 48 let x = o$.foo; |
| 49 o$.foo = dart.dsend(x, '+', 1); |
| 50 expect$.Expect.equals(5, x); |
| 51 let o$0 = const$1 || (const$1 = dart.const(new const_test.BConst())), i = 5; |
| 52 let y = o$0.get(i); |
| 53 o$0.set(i, dart.dsend(y, '+', 1)); |
| 54 expect$.Expect.equals(5, y); |
| 55 }; |
| 56 dart.fn(const_test.testMain, VoidTodynamic()); |
| 57 const_test.main = function() { |
| 58 for (let i = 0; i < 20; i++) { |
| 59 const_test.testMain(); |
| 60 } |
| 61 }; |
| 62 dart.fn(const_test.main, VoidTodynamic()); |
| 63 // Exports: |
| 64 exports.const_test = const_test; |
| 65 }); |
OLD | NEW |