OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/field_optimization3_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__field_optimization3_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 field_optimization3_test = Object.create(null); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 field_optimization3_test.A = class A extends core.Object { |
| 13 new() { |
| 14 this.a = 0; |
| 15 this.b = 0; |
| 16 } |
| 17 foo() { |
| 18 let c = dart.notNull(this.b) + 27; |
| 19 for (let i = 0; i < 1; i++) { |
| 20 for (let j = 0; j < 1; j++) { |
| 21 expect$.Expect.equals(50, c + 23); |
| 22 } |
| 23 } |
| 24 return dart.notNull(this.a) > 0.2; |
| 25 } |
| 26 setA(value) { |
| 27 this.a = core.int._check(value); |
| 28 } |
| 29 setB(value) { |
| 30 this.b = core.int._check(value); |
| 31 } |
| 32 ['>'](other) { |
| 33 return dart.equals(other, 0.2); |
| 34 } |
| 35 }; |
| 36 dart.setSignature(field_optimization3_test.A, { |
| 37 methods: () => ({ |
| 38 foo: dart.definiteFunctionType(dart.dynamic, []), |
| 39 setA: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]), |
| 40 setB: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]), |
| 41 '>': dart.definiteFunctionType(dart.dynamic, [dart.dynamic]) |
| 42 }) |
| 43 }); |
| 44 field_optimization3_test.main = function() { |
| 45 let a = new field_optimization3_test.A(); |
| 46 expect$.Expect.isFalse(a.foo()); |
| 47 a.setA(new field_optimization3_test.A()); |
| 48 a.setB(0); |
| 49 expect$.Expect.isTrue(a.foo()); |
| 50 }; |
| 51 dart.fn(field_optimization3_test.main, VoidTodynamic()); |
| 52 // Exports: |
| 53 exports.field_optimization3_test = field_optimization3_test; |
| 54 }); |
OLD | NEW |