Moving String.prototype.substr to normative part of the spec

Brendan Eich brendan at mozilla.org
Fri Aug 3 09:58:09 PDT 2012


History: substring was in JS 1.0 in 1995, based on JDK 1.0 
java.lang.String.substring -- including the quirk that misordered begin 
and end are swapped!

I recall adding substr at the start too, based on Perl.

I added slice based on Python in JS 1.2 in 1997, which fed into ES3.

So, Java/Perl/Python accumulation. Are we there yet?

/be

Rick Waldron wrote:
>
> On Friday, August 3, 2012 at 12:24 PM, David Bruant wrote:
>
>> Hi,
>>
>> A code joke from a colleague [1] revealed [2] that
>> String.prototype.substr is not part of ES5.1 as normative.
>> Kangax tables indicate that this property is in all modern browsers [3].
>> I think it'd be worth moving this method to the normative part of the
>> spec and that tests be added to test262 (since tests are on a chapter
>> basis, I assume there is currently none for this method).
> The method is in an annex (I'm mobile and can't really look it up).
>
> With slice and substring standardized, there would be a lot repeated 
> similar functionality
>
> Rick
>>
>> David
>>
>> [1] https://twitter.com/g_marty/status/231404856492036096
>> [2] https://twitter.com/mathias/status/231418712580845568
>> [3] http://kangax.github.com/es5-compat-table/non-standard/
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss


More information about the es-discuss mailing list