Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OldNativeFunction should catch exceptions thrown from native .impl and rethrow #457

Open
cpcallen opened this issue Mar 10, 2021 · 0 comments
Labels
bug server Things related to the codecity server proper

Comments

@cpcallen
Copy link
Collaborator

cpcallen commented Mar 10, 2021

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) NativeFunctions, 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.

@cpcallen cpcallen added bug server Things related to the codecity server proper labels Mar 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug server Things related to the codecity server proper
Projects
None yet
Development

No branches or pull requests

1 participant