packages/babel-plugin-transform-computed-properties/test/fixtures/spec/definition-order/exec.js
raw| 1 | var a = { |
| 2 | get ["x"]() { return 0; }, |
| 3 | ["y"]: 1, |
| 4 | }; |
| 5 | expect(Object.keys(a)).toStrictEqual(["x", "y"]); |
| 6 | |
| 7 | var b = { |
| 8 | get ["x"]() { return 0; }, |
| 9 | ["x"]: 1, |
| 10 | }; |
| 11 | expect(b.x).toBe(1); |
| 12 | |
| 13 | var x = 1; |
| 14 | var y = { x, get x() { return 0; }, x }; |
| 15 | expect(y.x).toBe(1); |
| 16 | y.x = 2; |
| 17 | expect(y.x).toBe(2); |