-
Notifications
You must be signed in to change notification settings - Fork 386
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
Array methods should respect the realm of the this
.
#293
Comments
Is there any way to test this without an iframe (in node)? The spec specifies "exotic Array object" only - is an Array from another iframe exotic? |
Realms are a red herring. Subclasses are the more interesting case where consulting this.constructor matters. |
Yap, you can use |
There's the perf side to consider; wrapping all those methods would be hella bad for that. Maybe this is one that es6-shim opts out of and just documents the lack of support. |
Indeed, that's one of my main concerns. At the least, we can ensure that our actual shims do the right thing, even if we choose not to detect and override every existing Array method :-) |
am i right, that this code should throw error (because NodeList is not constructable) according to spec? |
@Yaffle yes, I believe so. |
seems, this was discussed here: |
Wow, that's a shame, that's a really common existing pattern. |
For example see step 9 of this https://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.filter
The text was updated successfully, but these errors were encountered: