« Bugzilla Issues Index
#3208 — String.prototype.substr/slice language mistreats -0 as start
- bug_id:
3208
- creation_ts:
2014-09-02 14:57:00 -0700
- short_desc:
String.prototype.substr/slice language mistreats -0 as start
- delta_ts:
2014-10-14 15:17:46 -0700
- product:
Draft for 6th Edition
- component:
technical issue
- version:
Rev 27: August 24, 2014 Draft
- rep_platform:
All
- op_sys:
All
- bug_status:
RESOLVED
- resolution:
FIXED
- priority:
Normal
- bug_severity:
minor
- everconfirmed:
true
- reporter:
Jeff Walden (remove +beo to mail)
- assigned_to:
Allen Wirfs-Brock
- commentid:
10117
- comment_count:
0
- who:
Jeff Walden (remove +beo to mail)
- bug_when:
2014-09-02 14:57:21 -0700
Minor language nitpick in step 8:
8. If intStart is negative, then let intStart be max(size + intStart,0).
where |intStart| is |ToInteger(start)|, that being the zeroth argument passed to the method. Thus it's possible to get -0 here, so "negative" isn't the right description to use. "less than zero" would seem to do the trick.
(ES5 had "If Result(2) is positive or zero, use Result(2); else use max(Result(4)+Result(2),0)." so you definitely don't want -0 => size, but rather -0 => 0.)
- commentid:
10121
- comment_count:
1
- who:
Jeff Walden (remove +beo to mail)
- bug_when:
2014-09-02 18:14:54 -0700
Same issue with String.prototype.slice, except there wrt both start *and* end arguments.
- commentid:
10160
- comment_count:
2
- who:
Allen Wirfs-Brock
- bug_when:
2014-09-05 16:23:03 -0700
fixed in rev28 editor's draft
also fixed a number of additional occurrences
- commentid:
10395
- comment_count:
3
- who:
Allen Wirfs-Brock
- bug_when:
2014-10-14 15:17:46 -0700
fixed in rev28