Nicolò Ribaudo 60ef190d05
Define class elements in the correct order (#12723)
* Define class elements in the correct order

* Object.gOPDescriptors is not available on Node.js 6

* Handle numeric keys

* Update test

* Update fixtures
2021-02-02 02:22:16 +01:00

22 lines
320 B
JavaScript

let x = 1;
class A {
get [x]() {}
[(x = 3, 2)]() {}
set [x](_) {}
}
expect(Object.getOwnPropertyDescriptors(A.prototype)).toMatchObject({
1: {
get: expect.any(Function),
set: undefined,
},
2: {
value: expect.any(Function),
},
3: {
get: undefined,
set: expect.any(Function),
}
});