Currently, the following code: > await Promise.resolve(undefined).then(({default: a}) => a.true()) Produces the following messages: > TypeError: Right side of assignment cannot be destructured Instead, something closer to V8's message would be clearer: > TypeError: Cannot read properties of undefined It looks like the message is generated here: https://github.com/WebKit/WebKit/blob/8c684cfbe8afa5cb7eea0e46408cbdd31e920ba1/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp#L5607 It looks like the object can be at least null or undefined when this error is thrown, but it seems like most of these error messages are statically allocated which makes it harder to change them?
<rdar://problem/109136179>