mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
28 lines
502 B
JavaScript
28 lines
502 B
JavaScript
class Foo {
|
|
foo = 0;
|
|
|
|
test(other) {
|
|
return [
|
|
this.foo++,
|
|
this.foo,
|
|
++this.foo,
|
|
this.foo,
|
|
other.obj.foo++,
|
|
other.obj.foo,
|
|
++other.obj.foo,
|
|
other.obj.foo,
|
|
];
|
|
}
|
|
}
|
|
|
|
const f = new Foo;
|
|
const results = f.test({ obj: f });
|
|
expect(results[0]).toBe(0);
|
|
expect(results[1]).toBe(1);
|
|
expect(results[2]).toBe(2);
|
|
expect(results[3]).toBe(2);
|
|
expect(results[4]).toBe(2);
|
|
expect(results[5]).toBe(3);
|
|
expect(results[6]).toBe(4);
|
|
expect(results[7]).toBe(4);
|