]> git.saurik.com Git - apple/javascriptcore.git/blame - tests/stress/throw-from-ftl.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / throw-from-ftl.js
CommitLineData
ed1e77d3
A
1function foo(p) {
2 var o = {f:42};
3 if (p)
4 throw o;
5 return o;
6}
7
8noInline(foo);
9
10for (var i = 0; i < 100000; ++i) {
11 var o = foo(false);
12 if (o.f != 42)
13 throw "Error: bad result: " + o.f;
14}
15
16var didThrow = false;
17try {
18 foo(true);
19} catch (e) {
20 if (e.f != 42)
21 throw "Error: bad result in catch: " + o.f;
22 didThrow = true;
23}
24if (!didThrow)
25 throw "Error: should have thrown but didn't.";