Add Array[Symbol.species]
to symbol
#2690
Merged
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.
I'll admit it: this is a bit of a hack.
Like other
species
keys, this key properly belongs in thearray
feature. But it we can't put it there just yet.Because we added the array features early, it's broken down much more finely than other JavaScript collections (and lot of it ought to be combined, when we've dealt with #91). That means this key doesn't fit into very neatly into
array
or any of the other existing array features.But it also doesn't make sense as a standalone feature. It's really hard to describe an iffy contrivance as a "feature." I'm not even sure what the pitch is, exactly ("You can make a subclass of Array pretend to be an array"?). It's too weird.
So here I propose parking the key with the
symbol
feature and cleaning this up more thoroughly later.