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

LibJS: Add a [[Realm]] getter to FunctionObject and use it where needed #8338

Merged
merged 3 commits into from
Jun 30, 2021

Conversation

IdanHo
Copy link
Member

@IdanHo IdanHo commented Jun 30, 2021

Defined by https://tc39.es/ecma262/#sec-ordinaryfunctioncreate step #17 and by https://tc39.es/ecma262/#sec-createbuiltinfunction step #6.

(Also includes a small fix to String's constructor to make it use this underlying behaviour)

Fixes 30 test262 test cases.

@davidot
Copy link
Member

davidot commented Jun 30, 2021

I used global_object in array_species_create (not directly) perhaps this can also use the realm() for clarity?

@IdanHo
Copy link
Member Author

IdanHo commented Jun 30, 2021

I used global_object in array_species_create (not directly) perhaps this can also use the realm() for clarity?

The specification actually requires that ArraySpeciesCreate will use the GetFunctionRealm abstract operation, so i added a commit to fix that.

@linusg linusg merged commit dfed8f6 into SerenityOS:master Jun 30, 2021
@IdanHo IdanHo deleted the js_function_realm branch June 30, 2021 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants