OldNativeFunction should catch exceptions thrown from native .impl and rethrow
Open
bug
server
- Dominant language
- JavaScript
- Stars
- 198
- Forks
- 38
- PR merge metrics
- No merged PRs in 30d
Description
There are a small but non-zero number of native functions that we implement using `OldNativeFunction` (via `createNativeFunction`), including `String.prototype.localeCompare` that can throw (native) errors when given invalid arguments. This will cause the interpreter to crash.
These should probably ultimately be rewritten as (new) `NativeFunction`s, but in the interim `OldNativeFunction.prototype.call` and `.construct` should catch any native thrown by `this.impl.apply(…)` and rethrow the corresponding pseudo error generated by applying `errorNativeToPseudo`.
This is somewhat related to #456.
Contributor guide
Assessment
This issue has not been assessed yet.