« Bugzilla Issues Index
#3522 — Single argument Array.prototype.splice
- bug_id:
3522
- creation_ts:
2015-01-13 21:12:00 -0800
- short_desc:
Single argument Array.prototype.splice
- delta_ts:
2015-01-13 21:33:18 -0800
- product:
ECMA-262, Editions 5 and 5.1
- component:
technical content
- version:
other
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
INVALID
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
Adam Ahmed
- assigned_to:
Allen Wirfs-Brock
- commentid:
11348
- comment_count:
0
- who:
Adam Ahmed
- bug_when:
2015-01-13 21:12:19 -0800
Following on from https://esdiscuss.org/topic/single-argument-array-prototype-splice (yes that thread is 4 years old), it would seem that Array.prototype.splice's definition needs an update to spec the single -arg version as being equivalent to calling it with a second argument equal to the length of the array.
All major browsers and engines were in agreement, until Nashorn entered the game. Because they follow the spec as written, they have broken the de-facto standard. https://bugs.openjdk.java.net/browse/JDK-8023252
- commentid:
11349
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2015-01-13 21:30:28 -0800
Isn't that already handled in the ES6 spec.
See http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.splice
step 10
- commentid:
11350
- comment_count:
2
- who:
Adam Ahmed
- bug_when:
2015-01-13 21:33:18 -0800
Yes it is, I overlooked that! Thanks so much!