Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upisConcatSpreadable set to true #233
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
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.
|
By my reading, http://tc39.github.io/ecma262/#sec-isconcatspreadable indicates that if 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 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
nzakas
commented
Dec 7, 2015
|
Ah! Totally missed that. Thanks. |
nzakas commentedDec 7, 2015
I may be missing it, but I can't seem to find anything in the spec indicating that
@@isConcatSpreadableshould betruefor arrays.For
@@hasInstance, I noted this entry explaining the default value for functions: http://tc39.github.io/ecma262/#sec-function.prototype-@@hasinstanceI was expected to see something similar for
Array.prototype. Is this defined somewhere?