mirror of
https://github.com/tc39/test262.git
synced 2025-05-05 15:30:32 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
24 lines
988 B
JavaScript
24 lines
988 B
JavaScript
// Regression test for 159954. This test should not crash or throw an exception.
|
|
|
|
function testRegExp(regexpExpression)
|
|
{
|
|
try {
|
|
let result = eval(regexpExpression);
|
|
|
|
throw "Expected \"" + regexpExpression + "\" to throw and it didn't";
|
|
} catch (e) {
|
|
if (e != "SyntaxError: Invalid regular expression: pattern exceeds string length limits")
|
|
throw e;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
testRegExp("/a{2147483649,2147483650}a{2147483649,2147483650}/.exec('aaaa')");
|
|
testRegExp("/a{2147483649,2147483650}a{2147483649,2147483650}/.exec('aa')");
|
|
testRegExp("/(?:\1{2147483649,2147483650})+/.exec('123')");
|
|
testRegExp("/([^]{2147483648,2147483651}(?:.){2})+?/.exec('xxx')");
|
|
testRegExp("/(\u0004\W\u0f0b+?$[\xa7\t\t-\ue118\f]{2147483648,2147483648})+.+?/u.exec('testing')");
|
|
testRegExp("/(.{2147483649,2147483652})+?/g.exec('xxx')");
|
|
testRegExp("/(?:(?:[\D]{2147483649})+?.)*?/igmy.exec('123\\n123')");
|
|
testRegExp("/(?:\1{2147483648,})+?/m.exec('xxx')");
|