Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Should these names be added to @@unscopables? #74

Closed
ajklein opened this issue Dec 19, 2018 · 5 comments
Closed

Should these names be added to @@unscopables? #74

ajklein opened this issue Dec 19, 2018 · 5 comments

Comments

@ajklein
Copy link

ajklein commented Dec 19, 2018

Array methods added in ES2015 and ES2016 were added to the @@unscopables object attached to Array.prototype, to avoid a set of web-compat worries. Should flat and flatMap be added as well? Or was that considered and rejected for some reason?

Note that I'm not aware of any breakage due to them being left off, I just noticed this inconsistency while cleaning up some code.

@mathiasbynens

@mathiasbynens
Copy link
Member

Great catch! @michaelficarra, WDYT?

@michaelficarra
Copy link
Member

I'm fine either way. We could just add them for consistency, or we could also keep them out until/unless we find they are needed.

@mathiasbynens
Copy link
Member

I'm leaning towards adding them for consistency and "just in case".

V8 patch: https://chromium-review.googlesource.com/c/v8/v8/+/1390125

mathiasbynens added a commit to mathiasbynens/proposal-flatMap that referenced this issue Jan 3, 2019
mathiasbynens added a commit to mathiasbynens/proposal-flatMap that referenced this issue Jan 3, 2019
@mathiasbynens
Copy link
Member

Looking at this more closely, the text below the Array.prototype[@@unscopables] section in the spec makes it clear that the intention is to prevent issues, rather than fix only the cases that are known to break the web. Note the use of the word "might".

PR: #75

michaelficarra pushed a commit that referenced this issue Jan 3, 2019
peterwmwong pushed a commit to peterwmwong/v8 that referenced this issue Jan 7, 2019
tc39/proposal-flatMap#74
tc39/proposal-flatMap#75

BUG=v8:7220

Change-Id: I93ce66bddbb429beaa7486311f120ec32d6a35fb
Reviewed-on: https://chromium-review.googlesource.com/c/1390125
Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58537}
@tschneidereit
Copy link
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants