mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
31 lines
470 B
JavaScript
31 lines
470 B
JavaScript
const effects = [];
|
|
|
|
const object = {
|
|
value: 'this',
|
|
get method() {
|
|
effects.push(4);
|
|
return function (arg) {
|
|
effects.push(this.value);
|
|
effects.push(arg);
|
|
};
|
|
}
|
|
};
|
|
|
|
(do {
|
|
effects.push(1);
|
|
object
|
|
})[do {
|
|
effects.push(2);
|
|
"method"
|
|
}](do {
|
|
effects.push(3);
|
|
"arg"
|
|
});
|
|
|
|
(() => {
|
|
effects.push(5);
|
|
return { x: () => effects.push(6) };
|
|
})().x(do { effects.push(7); });
|
|
|
|
expect(effects).toEqual([1, 2, 4, 3, 'this', 'arg', 5, 7, 6]);
|