« Bugzilla Issues Index
#332 — 15.4.4.12 Array splice does not set result length correctly if trailing deleted elements are holes
- bug_id:
332
- creation_ts:
2012-04-09 09:01:00 -0700
- short_desc:
15.4.4.12 Array splice does not set result length correctly if trailing deleted elements are holes
- delta_ts:
2015-10-02 14:33:00 -0700
- product:
ECMA-262, Editions 5 and 5.1
- component:
technical content
- version:
Edition 5.1
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
normal
- everconfirmed:
true
- reporter:
Allen Wirfs-Brock
- assigned_to:
Allen Wirfs-Brock
- cc:
["john.david.dalton", "utatane.tea"]
- commentid:
860
- comment_count:
0
- who:
Allen Wirfs-Brock
- bug_when:
2012-04-09 09:01:35 -0700
Between lines 9.d and 10 and new top level line needs to be inserted:
10.0 Call the [[Put]] internal method of A with arguments "length", actualDeleteCount, and true.
The ES3 spec. has the equivalent of the above line. It was apparently inadvertently dropped in the ES5 spec.
Test case from John-David Dalton:
/ sparse array ;D
var a=[0];
a[2]=2;
// the resulting arrays length should be 2 and not 1
console.log(a.splice(0, 2).length);
ES3 spec would yield 2 for the above case. ES5/5/1 yields 1. That change was unintentional
Marked as "in progress" to flag as for errata
- commentid:
14724
- comment_count:
1
- who:
Brian Terlson
- bug_when:
2015-10-02 14:33:00 -0700
Bulk resolving ES5.1 errata issues as a sampling suggests these are all fixed. If this is in error, please open a new issue on GitHub.