archives

« Bugzilla Issues Index

#1131 — 15.12.3-11-26 should use String.prototype.substring or String.prototype.charAt


The test case uses String.prototype.substr which is listed in Annex B, therefore the test should be rewritten to use either String.prototype.substring or String.prototype.charAt


NOTE: Annex section B lists non-standard functions, so even though String.prototype.substr() is implemented in some implementations, it is NOT part of the standard and should NOT be included in the standard testsuite.

http://www.ecma-international.org/ecma-262/5.1/#sec-B.2.3

I'll provide a patch that removes this usage.


Created attachment 37
do not use String.prototype.substr()

Use String.prototype.charAt() instead of substr() since substr() is not actually part of the required spec.


Created attachment 41
remove String.prototype.substr() from testsuite


Reviewed patch for removing substr() and it looks good.


Created attachment 50
Move String.prototype.substr into annexB


Created attachment 58
Move String.prototype.substr into annexB

Exported change, including commit message


changeset: 373:579bd85aaf2a
user: Brent Baker <brbaker@adobe.com>
date: Wed Jun 05 08:00:44 2013 -0400
summary: Bug 1131: Move String.prototype.substr into annexB

NOTE: I am still waiting to get access to update the live website @ http://test262.ecmascript.org


Not resolved -> test case 15.12.3-11-26 is still using substr() instead of substring() or charAt().


(In reply to comment #8)
> Not resolved -> test case 15.12.3-11-26 is still using substr() instead of
> substring() or charAt().

Eek, I thought I had grepped all of the code, will get this fixed.


André, thank you for finding this. I mistakenly dropped the change from the patches as I reworked them. I have addressed the issue and did a grep of the testsuite to ensure that I hadn't missed any other instances.

Again thanks for double checking this.

changeset: d067d2f0ca30
tag: tip
user: Brent Baker <brbaker@adobe.com>
date: Thu Jun 13 10:07:45 2013 -0400
files: test/suite/ch15/15.12/15.12.3/15.12.3-11-26.js test/suite/ch15/15.2/15.2.2/S15.2.2.1_A2_T5.js website/json/ch15.json website/json/suiteDescrip.json
description:
Bug 1128: use Date.prototype.getFullYear() in S15.2.2.1_A2_T5
Bug 1131: use String.prototype.charAt() in 15.12.3-11-26

Both of these changes were accidentaly dropped when I regenerated patches for these bugs. I have grepped the testsuite to ensure that the annexB functions only appear in the annexB section of the testsuite.

NOTE: Also regenerated the website based on this change. (Still waiting for permission to actually update the live website)