зеркало из https://github.com/mozilla/pjs.git
Generalize test to use regular expression to prevent false failure in rhino
This commit is contained in:
Родитель
cb472f4afb
Коммит
b75f7c3624
|
@ -51,9 +51,15 @@ if (typeof uneval != 'undefined')
|
|||
b=function() {};
|
||||
}
|
||||
|
||||
expect = ' function a() { b = (function () {}); } ';
|
||||
var r = / function a\(\) \{ b = \(?function \(\) \{\s*\}\)?; \} /;
|
||||
eval(uneval(a));
|
||||
actual = a.toString().replace(/[ \n]+/g, ' ');
|
||||
|
||||
var v = a.toString().replace(/[ \n]+/g, ' ');
|
||||
|
||||
printStatus("[" + v + "]");
|
||||
|
||||
expect = true;
|
||||
actual = r.test(v);
|
||||
|
||||
reportCompare(expect, actual, summary);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче