14 lines
181 B
JavaScript
14 lines
181 B
JavaScript
function test(x) {
|
|
class F {
|
|
[x] = 1;
|
|
constructor() {}
|
|
}
|
|
|
|
x = 'deadbeef';
|
|
expect(new F().foo).toBe(1);
|
|
x = 'wrong';
|
|
expect(new F().foo).toBe(1);
|
|
}
|
|
|
|
test('foo');
|