OLD | NEW |
(Empty) | |
| 1 dart_library.library('language/getter_setter_order_test', null, /* Imports */[ |
| 2 'dart_sdk', |
| 3 'expect' |
| 4 ], function load__getter_setter_order_test(exports, dart_sdk, expect) { |
| 5 'use strict'; |
| 6 const core = dart_sdk.core; |
| 7 const _interceptors = dart_sdk._interceptors; |
| 8 const dart = dart_sdk.dart; |
| 9 const dartx = dart_sdk.dartx; |
| 10 const expect$ = expect.expect; |
| 11 const getter_setter_order_test = Object.create(null); |
| 12 let JSArrayOfString = () => (JSArrayOfString = dart.constFn(_interceptors.JSAr
ray$(core.String)))(); |
| 13 let VoidTodynamic = () => (VoidTodynamic = dart.constFn(dart.definiteFunctionT
ype(dart.dynamic, [])))(); |
| 14 getter_setter_order_test.trace = null; |
| 15 getter_setter_order_test.X = class X extends core.Object { |
| 16 get b() { |
| 17 dart.dsend(getter_setter_order_test.trace, 'add', 'get b'); |
| 18 return new getter_setter_order_test.X(); |
| 19 } |
| 20 set c(value) { |
| 21 dart.dsend(getter_setter_order_test.trace, 'add', 'set c'); |
| 22 } |
| 23 toString() { |
| 24 dart.dsend(getter_setter_order_test.trace, 'add', 'toString'); |
| 25 return 'X'; |
| 26 } |
| 27 get c() { |
| 28 dart.dsend(getter_setter_order_test.trace, 'add', 'get c'); |
| 29 return 42; |
| 30 } |
| 31 get d() { |
| 32 dart.dsend(getter_setter_order_test.trace, 'add', 'get d'); |
| 33 return new getter_setter_order_test.X(); |
| 34 } |
| 35 get(index) { |
| 36 dart.dsend(getter_setter_order_test.trace, 'add', 'index'); |
| 37 return 42; |
| 38 } |
| 39 set(index, value) { |
| 40 dart.dsend(getter_setter_order_test.trace, 'add', 'indexSet'); |
| 41 return value; |
| 42 } |
| 43 }; |
| 44 dart.setSignature(getter_setter_order_test.X, { |
| 45 methods: () => ({ |
| 46 get: dart.definiteFunctionType(dart.dynamic, [dart.dynamic]), |
| 47 set: dart.definiteFunctionType(dart.dynamic, [dart.dynamic, dart.dynamic]) |
| 48 }) |
| 49 }); |
| 50 getter_setter_order_test.main = function() { |
| 51 let x = new getter_setter_order_test.X(); |
| 52 getter_setter_order_test.trace = []; |
| 53 dart.dput(x.b, 'c', dart.str`${x}`); |
| 54 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'toString', 'set c'
]), core.List._check(getter_setter_order_test.trace)); |
| 55 getter_setter_order_test.trace = []; |
| 56 let o = x.b; |
| 57 dart.dput(o, 'c', dart.dsend(dart.dload(o, 'c'), '+', dart.hashCode(dart.str
`${x}`))); |
| 58 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get c', 'toString'
, 'set c']), core.List._check(getter_setter_order_test.trace)); |
| 59 getter_setter_order_test.trace = []; |
| 60 let o$ = x.b; |
| 61 dart.dput(o$, 'c', dart.dsend(dart.dload(o$, 'c'), '+', 1)); |
| 62 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get c', 'set c']),
core.List._check(getter_setter_order_test.trace)); |
| 63 getter_setter_order_test.trace = []; |
| 64 dart.dsetindex(dart.dload(x.b, 'd'), 42, dart.str`${x}`); |
| 65 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'toString'
, 'indexSet']), core.List._check(getter_setter_order_test.trace)); |
| 66 getter_setter_order_test.trace = []; |
| 67 let o$0 = dart.dload(x.b, 'd'), i = 42; |
| 68 dart.dsetindex(o$0, i, dart.dsend(dart.dindex(o$0, i), '+', dart.hashCode(da
rt.str`${x}`))); |
| 69 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'index', '
toString', 'indexSet']), core.List._check(getter_setter_order_test.trace)); |
| 70 getter_setter_order_test.trace = []; |
| 71 let o$1 = dart.dload(x.b, 'd'), i$ = 42; |
| 72 dart.dsetindex(o$1, i$, dart.dsend(dart.dindex(o$1, i$), '+', 1)); |
| 73 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'index', '
indexSet']), core.List._check(getter_setter_order_test.trace)); |
| 74 getter_setter_order_test.trace = []; |
| 75 let o$2 = dart.dload(x.b, 'd'), i$0 = 42; |
| 76 dart.dsetindex(o$2, i$0, dart.dsend(dart.dindex(o$2, i$0), '+', 1)); |
| 77 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'index', '
indexSet']), core.List._check(getter_setter_order_test.trace)); |
| 78 getter_setter_order_test.trace = []; |
| 79 let o$3 = dart.dload(x.b, 'd'), i$1 = x.c; |
| 80 dart.dsetindex(o$3, i$1, dart.dsend(dart.dindex(o$3, i$1), '*', dart.hashCod
e(dart.str`${x}`))); |
| 81 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'get c', '
index', 'toString', 'indexSet']), core.List._check(getter_setter_order_test.trac
e)); |
| 82 getter_setter_order_test.trace = []; |
| 83 dart.dput(x.b, 'c', dart.dput(x.d, 'c', dart.str`${x}`)); |
| 84 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'toString'
, 'set c', 'set c']), core.List._check(getter_setter_order_test.trace)); |
| 85 getter_setter_order_test.trace = []; |
| 86 dart.dput(x.b, 'c', (() => { |
| 87 let o = x.d, i = 42; |
| 88 return dart.dsetindex(o, i, dart.dsend(dart.dindex(o, i), '*', dart.hashCo
de(dart.str`${x}`))); |
| 89 })()); |
| 90 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'index', '
toString', 'indexSet', 'set c']), core.List._check(getter_setter_order_test.trac
e)); |
| 91 getter_setter_order_test.trace = []; |
| 92 dart.dput(x.b, 'c', (() => { |
| 93 let o = x.d; |
| 94 return dart.dput(o, 'c', dart.dsend(dart.dload(o, 'c'), '+', 1)); |
| 95 })()); |
| 96 expect$.Expect.listEquals(JSArrayOfString().of(['get b', 'get d', 'get c', '
set c', 'set c']), core.List._check(getter_setter_order_test.trace)); |
| 97 }; |
| 98 dart.fn(getter_setter_order_test.main, VoidTodynamic()); |
| 99 // Exports: |
| 100 exports.getter_setter_order_test = getter_setter_order_test; |
| 101 }); |
OLD | NEW |