-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: Implement JSValue::new_function
#20
Conversation
This patch adds a new `JSContext::new_inner` method as a quick constructor for `JSContext`.
This patch adds `JSObject::new_inner` to build a `JSObject` from its raw value.
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.
Should the new_inner
to from_raw
be a separate commit?
If it is hard, then let's not worry about it, I guess.
The clippy fix commit should get smashed back into the commit that started the problem so that the commit history remains fairly clean.
I'm out at the moment and want to look at the actual changes a bit more in about 2 hours when I'm back home.
(But I should say that I'm excited about this!) |
The change from I've changed to |
This patch implements `JSValue::new_function`. In addition, it creates a new `javascriptcore_macros` crate, to expose a `function_callback` procedural macro. It's helpful to easily create a function callback.
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.
Going to go with this. Have some things that we should discuss, but for subsequent commits.
Thanks a ton for this! |
This PR is twofold: first it creates
JSValue::new_function
, second it creates a procedural macro namedfunction_callback
to create function callbacks more easily.Check out this test: