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

isConcatSpreadable set to true #233

Closed
nzakas opened this Issue Dec 7, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@nzakas

nzakas commented Dec 7, 2015

I may be missing it, but I can't seem to find anything in the spec indicating that @@isConcatSpreadable should be true for arrays.

For @@hasInstance, I noted this entry explaining the default value for functions: http://tc39.github.io/ecma262/#sec-function.prototype-@@hasinstance

I was expected to see something similar for Array.prototype. Is this defined somewhere?

@ljharb

This comment has been minimized.

Show comment
Hide comment
@ljharb

ljharb Dec 7, 2015

Member

By my reading, http://tc39.github.io/ecma262/#sec-isconcatspreadable indicates that if Symbol.isConcatSpreadable is not present, then it falls back to IsArray - and also that it is not initially present on any value.

My understanding is that the well-known symbol is provided as an opt-out mechanism for Array subclasses who do not want the spreading behavior of concat, to ensure that legacy code paths continue to work with Arrays.

Member

ljharb commented Dec 7, 2015

By my reading, http://tc39.github.io/ecma262/#sec-isconcatspreadable indicates that if Symbol.isConcatSpreadable is not present, then it falls back to IsArray - and also that it is not initially present on any value.

My understanding is that the well-known symbol is provided as an opt-out mechanism for Array subclasses who do not want the spreading behavior of concat, to ensure that legacy code paths continue to work with Arrays.

@nzakas

This comment has been minimized.

Show comment
Hide comment
@nzakas

nzakas Dec 7, 2015

Ah! Totally missed that. Thanks.

nzakas commented Dec 7, 2015

Ah! Totally missed that. Thanks.

@nzakas nzakas closed this Dec 7, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment