-
-
Notifications
You must be signed in to change notification settings - Fork 57
JS Exception Support #102
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
JS Exception Support #102
Conversation
|
Time Change: +75.5ms (0%) Total Time: 10,698ms
i️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, awesome work!
Runtime/src/index.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’m pretty sure new can’t return a non-object. If you try to return a non-object in a constructor, it will use the this value instead.
See the spec here, where step 12 is the most relevant.
@j-f1 @MaxDesiatov What do you think about this API? I think there may be better interface.
If there's a better API for it, I can't come up with it...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! We’re not at 1.0 yet so we can continue to iterate if necessary.
Uh oh!
There was an error while loading. Please reload this page.
Currently, there is no way to catch exceptions thrown by JavaScript functions using JavaScriptKit.
This PR introduces new two APIs to catch exceptions.
JSFunction.throwsJSObject.throwingJSFunction.throwsconvertsJSFunctioninto throwable function.JSObject.throwingprovides throwing method call API capturingthiscontext.These two APIs have different names to avoid overload ambiguity.
e.g.