| 15.5.4.11.js |
|
9053 |
- |
| 15.10.6.2-2.js |
Date: 18 Feb 2002
SUMMARY: Testing re.exec(str) when re.lastIndex is < 0 or > str.length
Case 1: If re has the global flag set, then re(str) should be null
Case 2: If re doesn't have this set, then re(str) should be unaffected
See http://bugzilla.mozilla.org/show_bug.cgi?id=76717
From the ECMA-262 Final spec:
15.10.6.2 RegExp.prototype.exec(string)
Performs a regular expression match of string against the regular
expression and returns an Array object containing the results of
the match, or null if the string did not match.
The string ToString(string) is searched for an occurrence of the
regular expression pattern as follows:
1. Let S be the value of ToString(string).
2. Let length be the length of S.
3. Let lastIndex be the value of the lastIndex property.
4. Let i be the value of ToInteger(lastIndex).
5. If the global property is false, let i = 0.
6. If i < 0 or i > length then set lastIndex to 0 and return null.
7. Call [[Match]], giving it the arguments S and i.
If [[Match]] returned failure, go to step 8;
otherwise let r be its State result and go to step 10.
8. Let i = i+1.
9. Go to step 6.
10. Let e be r's endIndex value.
11. If the global property is true, set lastIndex to e.
etc.
So:
A. If the global flag is not set, |lastIndex| is set to 0
before the match is attempted; thus the match is unaffected.
B. If the global flag IS set and re.lastIndex is >= 0 and <= str.length,
|lastIndex| is incremented every time there is a match; not from
i to i+1, but from i to "endIndex" e:
e = (index of last input character matched so far by the pattern) + 1
The match is then attempted from this position in the string (Step 7).
C. When the global flag IS set and re.lastIndex is < 0 or > str.length,
|lastIndex| is set to 0 and the match returns null.
Note the |lastIndex| property is writeable, and may be set arbitrarily
by the programmer - and we will do that below.
|
8383 |
- |
| browser.js |
|
0 |
- |
| character-class-escape-s.js |
Generated by make_unicode.py DO NOT MODIFY |
1913 |
- |
| character-escape-class-s-mongolian-vowel-separator.js |
|
1178 |
- |
| compile-symbol.js |
|
486 |
- |
| constructor-symbol.js |
|
596 |
- |
| control_characters.js |
Filename: control_characters.js
Description: 'Tests regular expressions containing .'
Author: Nick Lerissa
Date: April 8, 1998
|
1241 |
- |
| everything.js |
Filename: everything.js
Description: 'Tests regular expressions'
Author: Nick Lerissa
Date: March 24, 1998
|
2184 |
- |
| exec-002.js |
File Name: RegExp/exec-002.js
ECMA Section: 15.7.5.3
Description: Based on ECMA 2 Draft 7 February 1999
Test cases provided by rogerl@netscape.com
Author: christine@netscape.com
Date: 19 February 1999
|
3269 |
- |
| multiline-001.js |
File Name: RegExp/multiline-001.js
ECMA Section:
Description: Based on ECMA 2 Draft 7 February 1999
Date: 19 February 1999
|
1696 |
- |
| octal-001.js |
File Name: RegExp/octal-001.js
ECMA Section: 15.7.1
Description: Based on ECMA 2 Draft 7 February 1999
Simple test cases for matching OctalEscapeSequences.
Author: christine@netscape.com
Date: 19 February 1999
|
1949 |
- |
| octal-002.js |
File Name: RegExp/octal-002.js
ECMA Section: 15.7.1
Description: Based on ECMA 2 Draft 7 February 1999
Simple test cases for matching OctalEscapeSequences.
Author: christine@netscape.com
Date: 19 February 1999
|
2443 |
- |
| octal-003.js |
File Name: RegExp/octal-003.js
ECMA Section: 15.7.1
Description: Based on ECMA 2 Draft 7 February 1999
Simple test cases for matching OctalEscapeSequences.
Author: christine@netscape.com
Date: 19 February 1999
Revised: 02 August 2002
Author: pschwartau@netscape.com
WHY: the original test expected the regexp /.\011/
to match 'a' + String.fromCharCode(0) + '11'
This is incorrect: the string is a 4-character string consisting of
the characters <'a'>, <nul>, <'1'>, <'1'>. By contrast, the \011 in the
regexp should be parsed as a single token: it is the octal escape sequence
for the horizontal tab character '\t' === '\u0009' === '\x09' === '\011'.
So the regexp consists of 2 characters: <any-character>, <'\t'>.
There is no match between the regexp and the string.
See the testcase non262/RegExp/octal-002.js for an elaboration.
|
2704 |
- |
| oom-in-construction.js |
|
376 |
- |
| perlstress-001.js |
Date: 2002-07-07
SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine.
Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested.
This test was created by running various patterns and strings through the
Perl 5 RegExp engine. We saved the results below to test the JS engine.
NOTE: ECMA/JS and Perl do differ on certain points. We have either commented
out such sections altogether, or modified them to fit what we expect from JS.
EXAMPLES:
- In JS, regexp captures (/(a) etc./) must hold |undefined| if not used.
See http://bugzilla.mozilla.org/show_bug.cgi?id=123437.
By contrast, in Perl, unmatched captures hold the empty string.
We have modified such sections accordingly. Example:
pattern = /^([^a-z])|(\^)$/;
string = '.';
actualmatch = string.match(pattern);
//expectedmatch = Array('.', '.', ''); <<<--- Perl
expectedmatch = Array('.', '.', undefined); <<<--- JS
addThis();
- In JS, you can't refer to a capture before it's encountered & completed
- Perl supports ] & ^] inside a [], ECMA does not
- ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc.
- ECMA doesn't support (?imsx or (?-imsx
- ECMA doesn't support (?(condition)
- Perl has \Z has end-of-line, ECMA doesn't
- In ECMA, ^ matches only the empty string before the first character
- In ECMA, $ matches only the empty string at end of input (unless multiline)
- ECMA spec says that each atom in a range must be a single character
- ECMA doesn't support \A
- ECMA doesn't have rules for [:
|
75051 |
- |
| perlstress-002.js |
Date: 2002-07-07
SUMMARY: Testing JS RegExp engine against Perl 5 RegExp engine.
Adjust cnLBOUND, cnUBOUND below to restrict which sections are tested.
This test was created by running various patterns and strings through the
Perl 5 RegExp engine. We saved the results below to test the JS engine.
Each of the examples below is a negative test; that is, each produces a
null match in Perl. Thus we set |expectedmatch| = |null| in each section.
NOTE: ECMA/JS and Perl do differ on certain points. We have either commented
out such sections altogether, or modified them to fit what we expect from JS.
EXAMPLES:
- ECMA does support (?: (?= and (?! operators, but doesn't support (?< etc.
- ECMA doesn't support (?(condition)
|
35895 |
- |
| properties-001.js |
File Name: RegExp/properties-001.js
ECMA Section: 15.7.6.js
Description: Based on ECMA 2 Draft 7 February 1999
Author: christine@netscape.com
Date: 19 February 1999
|
2664 |
- |
| properties-002.js |
File Name: RegExp/properties-002.js
ECMA Section: 15.7.6.js
Description: Based on ECMA 2 Draft 7 February 1999
Author: christine@netscape.com
Date: 19 February 1999
|
3645 |
- |
| regexp-enumerate-001.js |
File Name: regexp-enumerate-001.js
ECMA V2 Section:
Description: Regression Test.
If instance Native Object have properties that are enumerable,
JavaScript enumerated through the properties twice. This only
happened if objects had been instantiated, but their properties
had not been enumerated. ie, the object inherited properties
from its prototype that are enumerated.
In the core JavaScript, this is only a problem with RegExp
objects, since the inherited properties of most core JavaScript
objects are not enumerated.
Author: christine@netscape.com, pschwartau@netscape.com
Date: 12 November 1997
Modified: 14 July 2002
Reason: See http://bugzilla.mozilla.org/show_bug.cgi?id=155291
ECMA-262 Ed.3 Sections 15.10.7.1 through 15.10.7.5
RegExp properties should be DontEnum
|
2175 |
- |
| regexp-space-character-class.js |
|
919 |
- |
| RegExp_dollar_number.js |
Filename: RegExp_dollar_number.js
Description: 'Tests RegExps $1, ..., $9 properties'
Author: Nick Lerissa
Date: March 12, 1998
|
2812 |
- |
| RegExp_lastMatch.js |
Filename: RegExp_lastMatch.js
Description: 'Tests RegExps lastMatch property'
Author: Nick Lerissa
Date: March 12, 1998
|
1649 |
- |
| RegExp_lastMatch_as_array.js |
Filename: RegExp_lastMatch_as_array.js
Description: 'Tests RegExps $& property (same tests as RegExp_lastMatch.js but using $&)'
Author: Nick Lerissa
Date: March 13, 1998
|
1630 |
- |
| RegExp_lastParen.js |
Filename: RegExp_lastParen.js
Description: 'Tests RegExps lastParen property'
Author: Nick Lerissa
Date: March 12, 1998
|
2197 |
- |
| RegExp_lastParen_as_array.js |
Filename: RegExp_lastParen_as_array.js
Description: 'Tests RegExps $+ property (same tests as RegExp_lastParen.js but using $+)'
Author: Nick Lerissa
Date: March 13, 1998
|
2176 |
- |
| RegExp_leftContext.js |
Filename: RegExp_leftContext.js
Description: 'Tests RegExps leftContext property'
Author: Nick Lerissa
Date: March 12, 1998
|
1813 |
- |
| RegExp_leftContext_as_array.js |
Filename: RegExp_leftContext_as_array.js
Description: 'Tests RegExps leftContext property (same tests as RegExp_leftContext.js but using $`)'
Author: Nick Lerissa
Date: March 12, 1998
|
1747 |
- |
| RegExp_object.js |
Filename: RegExp_object.js
Description: 'Tests regular expressions creating RexExp Objects'
Author: Nick Lerissa
Date: March 10, 1998
|
2008 |
- |
| RegExp_rightContext.js |
Filename: RegExp_rightContext.js
Description: 'Tests RegExps rightContext property'
Author: Nick Lerissa
Date: March 12, 1998
|
1838 |
- |
| RegExp_rightContext_as_array.js |
Filename: RegExp_rightContext_as_array.js
Description: 'Tests RegExps $\' property (same tests as RegExp_rightContext.js but using $\)'
Author: Nick Lerissa
Date: March 12, 1998
|
1755 |
- |
| regress-001.js |
File Name: RegExp/regress-001.js
ECMA Section: N/A
Description: Regression test case:
JS regexp anchoring on empty match bug
http://bugzilla.mozilla.org/show_bug.cgi?id=2157
Author: christine@netscape.com
Date: 19 February 1999
|
1108 |
- |
| regress-6359.js |
File Name: regress-6359.js
Reference: ** replace with bugzilla URL or document reference **
Description: ** replace with description of test **
Author: ** replace with your e-mail address **
|
1763 |
- |
| regress-9141.js |
File Name: regress-9141.js
Reference: "http://bugzilla.mozilla.org/show_bug.cgi?id=9141";
Description:
From waldemar@netscape.com:
The following page crashes the system:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<HTML>
<HEAD>
</HEAD>
<BODY>
<SCRIPT type="text/javascript">
var s = "x";
for (var i = 0; i != 13; i++) s += s;
var a = /(?:xx|x)*[slash](s);
var b = /(xx|x)*[slash](s);
document.write("Results = " + a.length + "," + b.length);
</SCRIPT>
</BODY>
|
2174 |
- |
| regress-24712.js |
|
496 |
- |
| regress-28686.js |
|
424 |
- |
| regress-31316.js |
Date: 01 May 2001
SUMMARY: Regression test for Bugzilla bug 31316:
"Rhino: Regexp matches return garbage"
See http://bugzilla.mozilla.org/show_bug.cgi?id=31316
|
1591 |
- |
| regress-57572.js |
Date: 28 December 2000
SUMMARY: Testing regular expressions containing the ? character.
Arose from Bugzilla bug 57572: "RegExp with ? matches incorrectly"
See http://bugzilla.mozilla.org/show_bug.cgi?id=57572
|
3395 |
- |
| regress-57631.js |
Date: 26 November 2000
SUMMARY: This test arose from Bugzilla bug 57631:
"RegExp with invalid pattern or invalid flag causes segfault"
Either error should throw an exception of type SyntaxError,
and we check to see that it does...
|
3032 |
- |
| regress-67773.js |
Date: 06 February 2001
SUMMARY: Arose from Bugzilla bug 67773:
"Regular subexpressions followed by + failing to run to completion"
See http://bugzilla.mozilla.org/show_bug.cgi?id=67773
See http://bugzilla.mozilla.org/show_bug.cgi?id=69989
|
4364 |
- |
| regress-72964.js |
Date: 2001-07-17
SUMMARY: Regression test for Bugzilla bug 72964:
"String method for pattern matching failed for Chinese Simplified (GB2312)"
See http://bugzilla.mozilla.org/show_bug.cgi?id=72964
|
2268 |
- |
| regress-76683.js |
Date: 01 May 2001
SUMMARY: Regression test for Bugzilla bug 76683 on Rhino:
"RegExp regression (NullPointerException)"
See http://bugzilla.mozilla.org/show_bug.cgi?id=76683
|
2173 |
- |
| regress-78156.js |
Date: 06 February 2001
SUMMARY: Arose from Bugzilla bug 78156:
"m flag of regular expression does not work with $"
See http://bugzilla.mozilla.org/show_bug.cgi?id=78156
The m flag means a regular expression should search strings
across multiple lines, i.e. across '\n', '\r'.
|
2171 |
- |
| regress-87231.js |
Date: 22 June 2001
SUMMARY: Regression test for Bugzilla bug 87231:
"Regular expression /(A)?(A.*)/ picks 'A' twice"
See http://bugzilla.mozilla.org/show_bug.cgi?id=87231
Key case:
pattern = /^(A)?(A.*)$/;
string = 'A';
expectedmatch = Array('A', '', 'A');
We expect the 1st subexpression (A)? NOT to consume the single 'A'.
Recall that "?" means "match 0 or 1 times". Here, it should NOT do
greedy matching: it should match 0 times instead of 1. This allows
the 2nd subexpression to make the only match it can: the single 'A'.
Such "altruism" is the only way there can be a successful global match...
|
2935 |
- |
| regress-98306.js |
Date: 04 September 2001
SUMMARY: Regression test for Bugzilla bug 98306
"JS parser crashes in ParseAtom for script using Regexp()"
See http://bugzilla.mozilla.org/show_bug.cgi?id=98306
|
1303 |
- |
| regress-100199.js |
Date: 17 September 2001
SUMMARY: Regression test for Bugzilla bug 100199
See http://bugzilla.mozilla.org/show_bug.cgi?id=100199
The empty character class [] is a valid RegExp construct: the condition
that a given character belong to a set containing no characters. As such,
it can never be met and is always FALSE. Similarly, [^] is a condition
that matches any given character and is always TRUE.
Neither one of these conditions should cause syntax errors in a RegExp.
|
5680 |
- |
| regress-105972.js |
Date: 22 October 2001
SUMMARY: Regression test for Bugzilla bug 105972:
"/^.*?$/ will not match anything"
See http://bugzilla.mozilla.org/show_bug.cgi?id=105972
|
3285 |
- |
| regress-119909.js |
Date: 14 Jan 2002
SUMMARY: Shouldn't crash on regexps with many nested parentheses
See http://bugzilla.mozilla.org/show_bug.cgi?id=119909
|
1496 |
- |
| regress-122076.js |
Date: 12 Feb 2002
SUMMARY: Don't crash on invalid regexp literals / \\/ /
See http://bugzilla.mozilla.org/show_bug.cgi?id=122076
The function checkURL() below sometimes caused a compile-time error:
SyntaxError: unterminated parenthetical (:
However, sometimes it would cause a crash instead. The presence of
other functions below is merely fodder to help provoke the crash.
The constant |STRESS| is number of times we'll try to crash on this.
|
2219 |
- |
| regress-123437.js |
Date: 04 Feb 2002
SUMMARY: regexp backreferences must hold |undefined| if not used
See http://bugzilla.mozilla.org/show_bug.cgi?id=123437 (SpiderMonkey)
See http://bugzilla.mozilla.org/show_bug.cgi?id=123439 (Rhino)
|
1847 |
- |
| regress-165353.js |
Date: 31 August 2002
SUMMARY: RegExp conformance test
See http://bugzilla.mozilla.org/show_bug.cgi?id=165353
|
2163 |
- |
| regress-169497.js |
Date: 31 August 2002
SUMMARY: RegExp conformance test
See http://bugzilla.mozilla.org/show_bug.cgi?id=169497
|
1787 |
- |
| regress-169534.js |
Date: 20 Sep 2002
SUMMARY: RegExp conformance test
See http://bugzilla.mozilla.org/show_bug.cgi?id=169534
|
1428 |
- |
| regress-187133.js |
Date: 06 January 2003
SUMMARY: RegExp conformance test
See http://bugzilla.mozilla.org/show_bug.cgi?id=187133
The tests here employ the regular expression construct:
(?!pattern)
This is a "zero-width lookahead negative assertion".
From the Perl documentation:
For example, /foo(?!bar)/ matches any occurrence
of 'foo' that isn't followed by 'bar'.
It is "zero-width" means that it does not consume any characters and that
the parens are non-capturing. A non-null match array in the example above
will have only have length 1, not 2.
|
2524 |
- |
| regress-188206.js |
Date: 21 January 2003
SUMMARY: Invalid use of regexp quantifiers should generate SyntaxErrors
See http://bugzilla.mozilla.org/show_bug.cgi?id=188206
and http://bugzilla.mozilla.org/show_bug.cgi?id=85721#c48 etc.
and http://bugzilla.mozilla.org/show_bug.cgi?id=190685
and http://bugzilla.mozilla.org/show_bug.cgi?id=197451
|
3881 |
- |
| regress-191479.js |
Date: 31 January 2003
SUMMARY: Testing regular expressions of form /(x|y){n,}/
See http://bugzilla.mozilla.org/show_bug.cgi?id=191479
|
3761 |
- |
| regress-202564.js |
Date: 18 April 2003
SUMMARY: Testing regexp with many backreferences
See http://bugzilla.mozilla.org/show_bug.cgi?id=202564
Note that in Section 1 below, we expect the 1st and 4th backreferences
to hold |undefined| instead of the empty strings one gets in Perl and IE6.
This is because per ECMA, regexp backreferences must hold |undefined|
if not used. See http://bugzilla.mozilla.org/show_bug.cgi?id=123437.
|
1852 |
- |
| regress-209067.js |
Date: 12 June 2003
SUMMARY: Testing complicated str.replace()
See http://bugzilla.mozilla.org/show_bug.cgi?id=209067
|
78115 |
- |
| regress-209919.js |
Date: 19 June 2003
SUMMARY: Testing regexp submatches with quantifiers
See http://bugzilla.mozilla.org/show_bug.cgi?id=209919
|
3551 |
- |
| regress-216591.js |
Date: 19 August 2003
SUMMARY: Regexp conformance test
See http://bugzilla.mozilla.org/show_bug.cgi?id=216591
|
2222 |
- |
| regress-220367-001.js |
Date: 26 September 2003
SUMMARY: Regexp conformance test
See http://bugzilla.mozilla.org/show_bug.cgi?id=220367
|
1577 |
- |
| regress-223273.js |
Date: 23 October 2003
SUMMARY: Unescaped, unbalanced parens in a regexp should cause SyntaxError.
The same would also be true for unescaped, unbalanced brackets or braces
if we followed the ECMA-262 Ed. 3 spec on this. But it was decided for
backward compatibility reasons to follow Perl 5, which permits
1. an unescaped, unbalanced right bracket ]
2. an unescaped, unbalanced left brace {
3. an unescaped, unbalanced right brace }
If any of these should occur, Perl treats each as a literal
character. Therefore we permit all three of these cases, even
though not ECMA-compliant. Note Perl errors on an unescaped,
unbalanced left bracket; so will we.
See http://bugzilla.mozilla.org/show_bug.cgi?id=223273
|
5379 |
- |
| regress-223535.js |
Date: 24 October 2003
SUMMARY: Testing regexps with empty alternatives
See http://bugzilla.mozilla.org/show_bug.cgi?id=223535
|
2188 |
- |
| regress-224676.js |
Date: 04 November 2003
SUMMARY: Testing regexps with various disjunction + character class patterns
See http://bugzilla.mozilla.org/show_bug.cgi?id=224676
|
4233 |
- |
| regress-225289.js |
Date: 10 November 2003
SUMMARY: Testing regexps with complementary alternatives
See http://bugzilla.mozilla.org/show_bug.cgi?id=225289
|
3036 |
- |
| regress-225343.js |
Date: 11 November 2003
SUMMARY: Testing regexp character classes and the case-insensitive flag
See http://bugzilla.mozilla.org/show_bug.cgi?id=225343
|
2186 |
- |
| regress-285219.js |
|
584 |
- |
| regress-305064.js |
List from ES 3.1 Recommendation for String.trim (bug 305064) * |
1886 |
- |
| regress-309840.js |
|
586 |
- |
| regress-312351.js |
|
522 |
- |
| regress-334158.js |
|
817 |
- |
| regress-346090.js |
|
760 |
- |
| regress-367888.js |
|
733 |
- |
| regress-375642.js |
|
705 |
- |
| regress-375651.js |
|
739 |
- |
| regress-375711.js |
|
1758 |
- |
| regress-375715-01-n.js |
|
898 |
- |
| regress-375715-02.js |
|
723 |
- |
| regress-375715-03.js |
|
741 |
- |
| regress-375715-04.js |
|
910 |
- |
| regress-429241.js |
|
2958 |
- |
| regress-436700.js |
|
799 |
- |
| regress-465862.js |
|
2070 |
- |
| regress-617935.js |
Length of 32 |
974 |
- |
| regress-2018582.js |
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ |
585 |
- |
| shell.js |
---
defines: [testRegExp, makeExpectedMatch, checkRegExpMatch]
allow_unused: True
--- |
6961 |
- |
| unicode-ignoreCase.js |
Generated by make_unicode.py DO NOT MODIFY |
304954 |
- |
| unicode-index.js |
|
613 |
- |
| yflag.js |
calls to reportCompare invoke regular expression matches which interfere
with the test of the sticky flag. Collect expect and actual values prior
to calling reportCompare. Note setting y = /(1)/y resets the lastIndex etc.
|
3273 |
- |