mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-06 09:05:45 +00:00
Bug 613820: Regexp forwards ref in quantified parens test. (r=dmandelin)
This commit is contained in:
parent
cdd7186b5e
commit
27845cee6e
@ -6,5 +6,8 @@ script empty-lookahead.js
|
||||
script exec.js
|
||||
script exec-lastIndex-ToInteger.js
|
||||
script regress-576828.js
|
||||
script regress-613820-1.js
|
||||
script regress-613820-2.js
|
||||
script regress-613820-3.js
|
||||
silentfail skip-if(!xulRuntime.shell&&(Android||xulRuntime.OS=="WINNT")) script regress-617935.js
|
||||
script instance-property-storage-introspection.js
|
||||
|
9
js/src/tests/ecma_5/RegExp/regress-613820-1.js
Normal file
9
js/src/tests/ecma_5/RegExp/regress-613820-1.js
Normal file
@ -0,0 +1,9 @@
|
||||
/* Back reference is actually a forwards reference. */
|
||||
var re = /(\2(a)){2}/;
|
||||
var str = 'aaa';
|
||||
var actual = re.exec(str);
|
||||
var expected = makeExpectedMatch(['aa', 'a', 'a'], 0, str);
|
||||
checkRegExpMatch(actual, expected);
|
||||
|
||||
if (typeof reportCompare === 'function')
|
||||
reportCompare(true, true);
|
9
js/src/tests/ecma_5/RegExp/regress-613820-2.js
Normal file
9
js/src/tests/ecma_5/RegExp/regress-613820-2.js
Normal file
@ -0,0 +1,9 @@
|
||||
/* Resetting of inner capture groups across quantified capturing parens. */
|
||||
var re = /(?:(f)(o)(o)|(b)(a)(r))*/;
|
||||
var str = 'foobar';
|
||||
var actual = re.exec(str);
|
||||
var expected = makeExpectedMatch(['foobar', undefined, undefined, undefined, 'b', 'a', 'r'], 0, str);
|
||||
checkRegExpMatch(actual, expected);
|
||||
|
||||
if (typeof reportCompare === 'function')
|
||||
reportCompare(true, true);
|
9
js/src/tests/ecma_5/RegExp/regress-613820-3.js
Normal file
9
js/src/tests/ecma_5/RegExp/regress-613820-3.js
Normal file
@ -0,0 +1,9 @@
|
||||
/* Capture group reset to undefined during second iteration, so backreference doesn't see prior result. */
|
||||
var re = /(?:^(a)|\1(a)|(ab)){2}/;
|
||||
var str = 'aab';
|
||||
var actual = re.exec(str);
|
||||
var expected = makeExpectedMatch(['aa', undefined, 'a', undefined], 0, str);
|
||||
checkRegExpMatch(actual, expected);
|
||||
|
||||
if (typeof reportCompare === 'function')
|
||||
reportCompare(true, true);
|
Loading…
Reference in New Issue
Block a user