зеркало из https://github.com/mozilla/gecko-dev.git
The behavior of toString() and toSource() on empty regexps has changed. See bug 225550 and bug 226045.
This commit is contained in:
Родитель
157dedc0c2
Коммит
f457eaa80d
|
@ -56,8 +56,15 @@ function AddRegExpCases( re, s, g, i, m, l ) {
|
|||
s,
|
||||
re.source );
|
||||
|
||||
/*
|
||||
* http://bugzilla.mozilla.org/show_bug.cgi?id=225550 changed
|
||||
* the behavior of toString() and toSource() on empty regexps.
|
||||
* So branch if |s| is the empty string -
|
||||
*/
|
||||
var S = s? s : '(?:)';
|
||||
|
||||
AddTestCase( re + ".toString()",
|
||||
"/" + s +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""),
|
||||
"/" + S +"/" + (g?"g":"") + (i?"i":"") +(m?"m":""),
|
||||
re.toString() );
|
||||
|
||||
AddTestCase( re + ".global",
|
||||
|
|
|
@ -38,10 +38,13 @@
|
|||
var count = 0;
|
||||
var testcases = new Array();
|
||||
|
||||
// var re = new RegExp(); re.toString()
|
||||
/*
|
||||
* var re = new RegExp(); re.toString() For what to expect,
|
||||
* see http://bugzilla.mozilla.org/show_bug.cgi?id=225343#c7
|
||||
*/
|
||||
var re = new RegExp();
|
||||
testcases[count++] = new TestCase ( SECTION, "var re = new RegExp(); re.toString()",
|
||||
'//', re.toString());
|
||||
'/(?:)/', re.toString());
|
||||
|
||||
// re = /.+/; re.toString();
|
||||
re = /.+/;
|
||||
|
|
Загрузка…
Ссылка в новой задаче