| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
var gTestfile = 'regress-230216-1.js'; |
| 7 |
|
| 8 |
var BUGNUMBER = 230216; |
| 9 |
var summary = 'check for numerical overflow in regexps in back reference and bounds for {} quantifier'; |
| 10 |
var actual = ''; |
| 11 |
var expect = ''; |
| 12 |
var status = ''; |
| 13 |
|
| 14 |
printBugNumber(BUGNUMBER); |
| 15 |
printStatus (summary); |
| 16 |
|
| 17 |
status = inSection(1) + ' check for overflow in backref'; |
| 18 |
|
| 19 |
actual = 'undefined'; |
| 20 |
expect = false; |
| 21 |
|
| 22 |
try |
| 23 |
{ |
| 24 |
actual = eval('/(a)\21474836481/.test("aa")'); |
| 25 |
} |
| 26 |
catch(e) |
| 27 |
{ |
| 28 |
status += ' Error: ' + e; |
| 29 |
} |
| 30 |
|
| 31 |
reportCompare(expect, actual, status); |
| 32 |
|
| 33 |
status = inSection(2) + ' check for overflow in backref'; |
| 34 |
|
| 35 |
actual = 'undefined'; |
| 36 |
expect = false; |
| 37 |
|
| 38 |
try |
| 39 |
{ |
| 40 |
actual = eval('/a\21474836480/.test("")'); |
| 41 |
} |
| 42 |
catch(e) |
| 43 |
{ |
| 44 |
status += ' Error: ' + e; |
| 45 |
} |
| 46 |
|
| 47 |
reportCompare(expect, actual, status); |
| 48 |
|