OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/issue12288_test', null, /* Imports */[ |
| 2 'dart_sdk' |
| 3 ], function load__issue12288_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 issue12288_test = Object.create(null); |
| 10 let JSArrayOfElement = () => (JSArrayOfElement = dart.constFn(_interceptors.JS
Array$(issue12288_test.Element)))(); |
| 11 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 12 issue12288_test.main = function() { |
| 13 let parent = new issue12288_test.Element(null); |
| 14 let child = new issue12288_test.Element(parent); |
| 15 let result = child.path0[dartx.length]; |
| 16 if (result != 2) { |
| 17 dart.throw(dart.str`Expected 2, but child.path0.length was ${result}`); |
| 18 } |
| 19 }; |
| 20 dart.fn(issue12288_test.main, VoidTodynamic()); |
| 21 issue12288_test.Element = class Element extends core.Object { |
| 22 new(parent) { |
| 23 this.parent = parent; |
| 24 } |
| 25 get path0() { |
| 26 if (this.parent == null) { |
| 27 return JSArrayOfElement().of([this]); |
| 28 } else { |
| 29 let list = this.parent.path0; |
| 30 list[dartx.add](this); |
| 31 return list; |
| 32 } |
| 33 } |
| 34 }; |
| 35 dart.setSignature(issue12288_test.Element, { |
| 36 constructors: () => ({new: dart.definiteFunctionType(issue12288_test.Element
, [issue12288_test.Element])}) |
| 37 }); |
| 38 // Exports: |
| 39 exports.issue12288_test = issue12288_test; |
| 40 }); |
OLD | NEW |