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 upIs Note 2 from Array.prototype.slice meaningful? #219
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
anba
Nov 25, 2015
Contributor
The explicit Set() was erroneously removed in ES5, it is present in ES3 (ES3, 15.4.4.10 Array.prototype.slice, step 19): https://bugs.ecmascript.org/show_bug.cgi?id=417
|
The explicit Set() was erroneously removed in ES5, it is present in ES3 (ES3, 15.4.4.10 Array.prototype.slice, step 19): https://bugs.ecmascript.org/show_bug.cgi?id=417 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Nov 25, 2015
Member
I can see how that's needed in ES5, since it constructs an empty array. However, in ES2015, we start with ArraySpeciesCreate of the appropriate length.
|
I can see how that's needed in ES5, since it constructs an empty array. However, in ES2015, we start with ArraySpeciesCreate of the appropriate length. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
anba
Nov 25, 2015
Contributor
I just wanted to provide the history behind the Set() call, I don't think I care whether or not it's present. But if it gets removed from Array.prototype.slice, it should also get removed from Array.prototype.splice (Set(A, "length", actualDeleteCount, true)).
|
I just wanted to provide the history behind the Set() call, I don't think I care whether or not it's present. But if it gets removed from Array.prototype.slice, it should also get removed from Array.prototype.splice ( |
bterlson
added
the
question
label
Dec 1, 2015
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
bterlson
Dec 1, 2015
Member
Leaving aside the issue of whether the set to length is still required (which we can consider if someone wants to seriously propose that), the note is confusing in light of ES2015 semantics. I will fix it presently.
|
Leaving aside the issue of whether the set to length is still required (which we can consider if someone wants to seriously propose that), the note is confusing in light of ES2015 semantics. I will fix it presently. |
littledan commentedNov 25, 2015
http://tc39.github.io/ecma262/#sec-array.prototype.slice
The explicit setting of length is a new change vs ES5. V8 implements it, and I don't see a downside from an implementation standpoint. But I don't understand what this note means. If this happens to be creating an %Array%, then doesn't ArraySpeciesCreate already start it out at the right final length, so the trailing holes will be present already?