-
Notifications
You must be signed in to change notification settings - Fork 867
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
Make NativeGlobal
not an IdFunctionCall
#1827
Make NativeGlobal
not an IdFunctionCall
#1827
Conversation
NativeGlobal
not an IdFunctionCall
- global functionsNativeGlobal
not an IdFunctionCall
8a18114
to
1cd8e55
Compare
Thanks -- FWIW I'm working on NativeString, and at one point worked on
NativeDate, so let me know before you tackle other things.
I'm also open to retiring some of the MozillaSuiteTest if it's no longer in
spec.
…On Wed, Feb 12, 2025 at 8:54 AM Andrea Bergia ***@***.***> wrote:
This is not finished yet, I still need to work on errors and to clean up
the code.
I'm just opening this in draft so that you know I'm working on it. 🙂
------------------------------
You can view, comment on, or merge this pull request online at:
#1827
Commit Summary
- 8a18114
<8a18114>
Make `NativeGlobal` not an `IdFunctionCall` - global functions
File Changes
(2 files <https://github.com/mozilla/rhino/pull/1827/files>)
- *M* rhino/src/main/java/org/mozilla/javascript/NativeGlobal.java
<https://github.com/mozilla/rhino/pull/1827/files#diff-ac0a67c64aa1fe3968e0df00f00cb4ee401a8e01eb9318ce9fd5fc644526b731>
(254)
- *M* tests/testsrc/test262.properties
<https://github.com/mozilla/rhino/pull/1827/files#diff-a0a0b00b58c93567b5b5104438f62bee8325199aa9df3f9b9b9009047522c145>
(93)
Patch Links:
- https://github.com/mozilla/rhino/pull/1827.patch
- https://github.com/mozilla/rhino/pull/1827.diff
—
Reply to this email directly, view it on GitHub
<#1827>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAD7I2Z64WMTBP6UOFYP46L2PN4EPAVCNFSM6AAAAABXADMHG2VHI2DSMVQWIX3LMV43ASLTON2WKOZSHA2DQOBUGA2TENQ>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
1cd8e55
to
5d73221
Compare
NativeGlobal
not an IdFunctionCall
NativeGlobal
not an IdFunctionCall
private static Boolean js_isXMLName(Context cx, Scriptable scope, Object[] args) { | ||
Object name = (args.length == 0) ? Undefined.instance : args[0]; | ||
XMLLib xmlLib = XMLLib.extractFromScope(scope); | ||
return ScriptRuntime.wrapBoolean(xmlLib.isXMLName(cx, name)); |
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.
This is minor, but I'm noticing that we don't really need "wrapBoolean" or even "wrapInt" any more, since auto-boxing just does that. If you agree we could take it out of a few places and be even cleaner.
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.
Sure thing! I didn't really look at those methods honestly, just refactored them out of the IdScriptableObject
's switch
as they were. 🙂
This looks great, and your "style" of doing this is nicer than what I was doing so I may make some changes. I have one minor nit as to whether we actually need "wrapBoolean" any more. I'm open to opinions either way, but I think that we can stop using it. |
Cool.... |
5d73221
to
dd490de
Compare
Rebased on top of |
Thanks! |
This makes
NativeGlobal
not implementIdFunctionCall
and turns all the method intoLambdaFunction
orLambdaConstructor
.There's a few complicated details for handling the built-in errors, but it all seems to work and fix a few small test262 cases.