You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
When a built-in gets initialized, not only the global binding gets updated, but the global object receives that built-in as a property.
This is a fairly inefficient way of doing this, since it clones the property and assigns it to the global object. Ideally, if I'm not mistaken, these properties shouldn't be declared in the global bindings, they should just be properties of the global binding, so we should avoid creating the global binding. Nevertheless, this, as I mentioned in #1987, this breaks a ton of tests.
The issue here is that the naming resolution at global level doesn't check the global object, unfortunately. Should this be changed?
Also, this doesn't solve the full issue, since the main problem of #1987 comes from the fact that the global object doesn't have any prototype, but as per the spec:
has a [[Prototype]] internal slot whose value is host-defined.
bugSomething isn't workingbuiltinsPRs and Issues related to builtins/intrinsicsrun-benchmarkLabel used to run banchmarks on PRs
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request fixes part of #1987.
It changes the following:
This is a fairly inefficient way of doing this, since it clones the property and assigns it to the global object. Ideally, if I'm not mistaken, these properties shouldn't be declared in the global bindings, they should just be properties of the global binding, so we should avoid creating the global binding. Nevertheless, this, as I mentioned in #1987, this breaks a ton of tests.
The issue here is that the naming resolution at global level doesn't check the global object, unfortunately. Should this be changed?
Also, this doesn't solve the full issue, since the main problem of #1987 comes from the fact that the global object doesn't have any prototype, but as per the spec:
Full spec
I could not find anywhere that the prototype should be the
Object
prototype, though. This would require some further changes to be fixed.