OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/field_increment_bailout_test', null, /* Imports *
/[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__field_increment_bailout_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const mirrors = dart_sdk.mirrors; |
| 8 const _interceptors = dart_sdk._interceptors; |
| 9 const dart = dart_sdk.dart; |
| 10 const dartx = dart_sdk.dartx; |
| 11 const expect$ = expect.expect; |
| 12 const field_increment_bailout_test = Object.create(null); |
| 13 let JSArrayOfint = () => (JSArrayOfint = dart.constFn(_interceptors.JSArray$(c
ore.int)))(); |
| 14 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 15 field_increment_bailout_test.N = class N extends core.Object { |
| 16 new(outgoing, incoming) { |
| 17 this.outgoing = outgoing; |
| 18 this.incoming = incoming; |
| 19 } |
| 20 }; |
| 21 dart.setSignature(field_increment_bailout_test.N, { |
| 22 constructors: () => ({new: dart.definiteFunctionType(field_increment_bailout
_test.N, [dart.dynamic, dart.dynamic])}) |
| 23 }); |
| 24 field_increment_bailout_test.A = class A extends core.Object { |
| 25 new(node) { |
| 26 this.node = node; |
| 27 this.list = dart.dload(node, 'outgoing'); |
| 28 this.offset = 0; |
| 29 } |
| 30 next() { |
| 31 let edge = dart.dindex(this.list, (() => { |
| 32 let x = this.offset; |
| 33 this.offset = dart.notNull(x) + 1; |
| 34 return x; |
| 35 })()); |
| 36 if (dart.equals(this.list, dart.dload(this.node, 'outgoing'))) { |
| 37 this.list = dart.dload(this.node, 'incoming'); |
| 38 this.offset = 0; |
| 39 } else |
| 40 this.list = null; |
| 41 return edge; |
| 42 } |
| 43 }; |
| 44 dart.setSignature(field_increment_bailout_test.A, { |
| 45 constructors: () => ({new: dart.definiteFunctionType(field_increment_bailout
_test.A, [dart.dynamic])}), |
| 46 methods: () => ({next: dart.definiteFunctionType(dart.dynamic, [])}) |
| 47 }); |
| 48 field_increment_bailout_test.L = dart.callableClass(function L(...args) { |
| 49 const self = this; |
| 50 function call(...args) { |
| 51 return self.call.apply(self, args); |
| 52 } |
| 53 call.__proto__ = this.__proto__; |
| 54 call.new.apply(call, args); |
| 55 return call; |
| 56 }, class L extends core.Object { |
| 57 new(list) { |
| 58 this.list = list; |
| 59 } |
| 60 noSuchMethod(mirror) { |
| 61 return mirrors.reflect(this.list).delegate(mirror); |
| 62 } |
| 63 }); |
| 64 dart.setSignature(field_increment_bailout_test.L, { |
| 65 constructors: () => ({new: dart.definiteFunctionType(field_increment_bailout
_test.L, [dart.dynamic])}) |
| 66 }); |
| 67 field_increment_bailout_test.main = function() { |
| 68 let o = new field_increment_bailout_test.A(new field_increment_bailout_test.
N(new field_increment_bailout_test.L(JSArrayOfint().of([1])), new field_incremen
t_bailout_test.L(JSArrayOfint().of([2])))); |
| 69 for (let i = 1; i <= 2; i++) |
| 70 expect$.Expect.equals(i, o.next()); |
| 71 expect$.Expect.equals(null, o.list); |
| 72 }; |
| 73 dart.fn(field_increment_bailout_test.main, VoidTodynamic()); |
| 74 // Exports: |
| 75 exports.field_increment_bailout_test = field_increment_bailout_test; |
| 76 }); |
OLD | NEW |