« Bugzilla Issues Index
#4052 — 22.2.3.26 %TypedArray%.prototype.subarray: Use standard array index conversion+validation
- bug_id:
4052
- creation_ts:
2015-02-21 08:34:00 -0800
- short_desc:
22.2.3.26 %TypedArray%.prototype.subarray: Use standard array index conversion+validation
- delta_ts:
2015-03-04 18:58:14 -0800
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 34: February 20, 2015 Release Candidate 1
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
normal
- everconfirmed:
true
- reporter:
André Bargull
- assigned_to:
Allen Wirfs-Brock
- commentid:
13226
- comment_count:
0
- who:
André Bargull
- bug_when:
2015-02-21 08:34:00 -0800
22.2.3.26 %TypedArray%.prototype.subarray( [ begin [ , end ] ] )
%TypedArray%.prototype.subarray should use the same relative array index processing steps as used everywhere else. That means:
Change steps 7-10 to:
> Let relativeBegin be ToInteger(begin).
> ReturnIfAbrupt(relativeBegin).
> If relativeBegin < 0, let beginIndex be max((srcLength + relativeBegin), 0); else let beginIndex be min(relativeBegin, srcLength).
Change steps 11-15 to:
> If end is undefined, let relativeEnd be srcLength; else let relativeEnd be ToInteger(end).
> ReturnIfAbrupt(relativeEnd).
> If relativeEnd < 0, let endIndex be max((srcLength + relativeEnd), 0); else let endIndex be min(relativeEnd, srcLength).
And finally steps 16-17 to:
> Let newLength be max(endIndex - beginIndex, 0).
- commentid:
13370
- comment_count:
1
- who:
Allen Wirfs-Brock
- bug_when:
2015-02-25 17:30:55 -0800
fixed in rev35 editor's draft
- commentid:
13486
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2015-03-04 18:58:14 -0800
fixed in rev35