« Bugzilla Issues Index
#1566 — ArrayBuffer.prototype.slice should return zero-length ArrayBuffer if final < first
- bug_id:
1566
- creation_ts:
2013-06-24 06:10:00 -0700
- short_desc:
ArrayBuffer.prototype.slice should return zero-length ArrayBuffer if final < first
- delta_ts:
2013-07-15 17:04:31 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 15: May 14, 2013 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
enhancement
- everconfirmed:
true
- reporter:
Dmitry Lomov
- assigned_to:
Allen Wirfs-Brock
- commentid:
4307
- comment_count:
0
- who:
Dmitry Lomov
- bug_when:
2013-06-24 06:10:01 -0700
To wit:
In Firefox and Chrome,
new ArrayBuffer(10).slice(2,1).byteLength
is 0.
The current spec in 15.13.5.5.3 prescribes, in step 11 "Let newLen be final-first", and then in step 15 call constructor on newLen, which throws for negative length.
However primo, current implementations return 0-length ArrayBuffer in that case, and secundo, the behavior of slice should be consistent with TypedArray.prototype.subarray spec, which prescribes returns 0-length TypedArray.
- commentid:
4312
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2013-06-24 15:49:03 -0700
fixed in rev 16 editor's draft
- commentid:
4521
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2013-07-15 17:04:31 -0700
fixed in rev16 draft. July 15, 2013