Moving String.prototype.substr to normative part of the spec
bruant.d at gmail.com
Fri Aug 3 11:19:57 PDT 2012
Le 03/08/2012 12:46, Rick Waldron a écrit :
> On Friday, August 3, 2012 at 12:24 PM, David Bruant wrote:
>> A code joke from a colleague  revealed  that
>> String.prototype.substr is not part of ES5.1 as normative.
>> Kangax tables indicate that this property is in all modern browsers .
>> 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
I definitely agree, but I don't think "repetition" is a valid argument
here. I'm concerned about interoperability and backward compatibility.
If all browsers have the same methods, the (normative part of the) spec
should include it. The web platform has all sort of overlapping
technologies to solve the same use cases, but it's important to specify
them all and not only a minimalist subset.
More information about the es-discuss