OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/code_motion_crash_test', null, /* Imports */[ |
| 2 'dart_sdk' |
| 3 ], function load__code_motion_crash_test(exports, dart_sdk) { |
| 4 'use strict'; |
| 5 const core = dart_sdk.core; |
| 6 const _interceptors = dart_sdk._interceptors; |
| 7 const dart = dart_sdk.dart; |
| 8 const dartx = dart_sdk.dartx; |
| 9 const code_motion_crash_test = Object.create(null); |
| 10 let JSArrayOfObject = () => (JSArrayOfObject = dart.constFn(_interceptors.JSAr
ray$(core.Object)))(); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 code_motion_crash_test.A = class A extends core.Object { |
| 13 foo() { |
| 14 new code_motion_crash_test.A().field = 42; |
| 15 } |
| 16 _() { |
| 17 this.finalField = 42; |
| 18 this.field = 2; |
| 19 } |
| 20 new() { |
| 21 this.finalField = JSArrayOfObject().of([new code_motion_crash_test.A._(),
new code_motion_crash_test.B(), new core.Object()])[dartx.get](1); |
| 22 this.field = 2; |
| 23 } |
| 24 }; |
| 25 dart.defineNamedConstructor(code_motion_crash_test.A, '_'); |
| 26 dart.setSignature(code_motion_crash_test.A, { |
| 27 constructors: () => ({ |
| 28 _: dart.definiteFunctionType(code_motion_crash_test.A, []), |
| 29 new: dart.definiteFunctionType(code_motion_crash_test.A, []) |
| 30 }), |
| 31 methods: () => ({foo: dart.definiteFunctionType(dart.dynamic, [])}) |
| 32 }); |
| 33 code_motion_crash_test.B = class B extends core.Object { |
| 34 foo() {} |
| 35 bar() {} |
| 36 }; |
| 37 dart.setSignature(code_motion_crash_test.B, { |
| 38 methods: () => ({ |
| 39 foo: dart.definiteFunctionType(dart.dynamic, []), |
| 40 bar: dart.definiteFunctionType(dart.dynamic, []) |
| 41 }) |
| 42 }); |
| 43 code_motion_crash_test.main = function() { |
| 44 let a = new code_motion_crash_test.A(); |
| 45 if (true) { |
| 46 let b = a.finalField; |
| 47 let d = a.field; |
| 48 dart.dsend(b, 'bar'); |
| 49 let c = a.finalField; |
| 50 dart.dsend(c, 'foo'); |
| 51 let e = a.field; |
| 52 if (dart.notNull(d) + dart.notNull(e) != 4) dart.throw('Test failed'); |
| 53 } |
| 54 }; |
| 55 dart.fn(code_motion_crash_test.main, VoidTodynamic()); |
| 56 // Exports: |
| 57 exports.code_motion_crash_test = code_motion_crash_test; |
| 58 }); |
OLD | NEW |