Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit b70852b

Browse files
author
Mike Lewis
committed
Improve reg exp restore sanity test
1 parent fdaeddb commit b70852b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/sanity.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,12 @@ assert(new IntlPolyfill.DateTimeFormat('en-us', {
5959
}).format(new Date(2016, 0, 1)), 'January', 'month should be long');
6060

6161
// issue #196
62-
(new Array(32768 + 1)).join('a').match(/^a*$/);
63-
assert(new IntlPolyfill.NumberFormat('de-DE', {
64-
minimumFractionDigits: 2,
65-
maximumFractionDigits: 2
66-
}).format(0.015), "0,02", 'RegExp too big warning');
62+
/a*$/.exec('b' + new Array(32768 + 1).join('a'));
63+
var leftContext = RegExp.leftContext;
64+
var input = RegExp.input;
65+
var lastMatch = RegExp.lastMatch;
66+
new IntlPolyfill.NumberFormat('de-DE');
67+
assert(RegExp.leftContext, leftContext, 'RegExp.leftContext restored');
68+
assert(RegExp.input, input, 'RegExp.input restored');
69+
assert(RegExp.lastMatch, lastMatch, 'RegExp.lastMatch restored');
6770
'a'.match(/a/);

0 commit comments

Comments
 (0)