Open
Description
A lot of JavaScript user code assumes that you can pass arbitrary values where JavaScript expects property keys.
Examples:
Object.defineProperty(…)
Object.getOwnPropertyDescriptor(…)
Reflect.defineProperty(…)
Reflect.deleteProperty(…)
Reflect.get(…)
Reflect.getOwnPropertyDescriptor(…)
Reflect.has(…)
Reflect.set(…)
This makes [[ProxyHandler]].ownKeys(…)
into a footgun, as user code might assume that the contents of the returned array‑like will be processed by ToPropertyKey(…)
, instead of throwing when it encounters a value that is neither a string, nor a symbol, like it does currently.
See also: microsoft/TypeScript#35594