Re: [heycam/webidl] `record<unsigned short, ...` (#978)

JS syntax permits “bare” number tokens without expression-enclosing brackets and bare strings without quotes if they are valid identifiers, but both are effectively shorthand — an ES property key is a string or symbol and any other value gets coerced:

```js
const o = ({ [{ toString: () => '1' }]: 'hello', [2n]: 'world' });
-> {1: "hello", 2: "world"}

[ Reflect.ownKeys(o)[0], typeof Reflect.ownKeys(o)[0] ];
-> [ "1", "string" ]
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/heycam/webidl/issues/978#issuecomment-823119064

Received on Tuesday, 20 April 2021 09:15:30 UTC