blob: a737429137c57fc13cc84afd5da7cab2843d7259 [file] [log] [blame]
fpizlo@apple.com239b0782016-03-03 05:58:59 +00001function foo(s) {
2 return /.*/.exec(s);
3}
4
5noInline(foo);
6
7for (var i = 0; i < 10000; ++i)
8 foo("foo bar");
9
10RegExp.input = "blah";
11
12var didFinish = false;
13try {
14 foo({toString: function() {
15 throw "error";
16 }});
17 didFinish = true;
18} catch (e) {
19 if (e != "error")
20 throw "Error: bad exception at end: " + e;
21 if (RegExp.input != "blah")
22 throw "Error: bad value of input: " + RegExp.input;
23}
24
25if (didFinish)
26 throw "Error: did not throw exception.";