]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(o) { |
2 | "use strict"; | |
3 | o.f = 42; | |
4 | } | |
5 | ||
6 | noInline(foo); | |
7 | ||
8 | for (var i = 0; i < 100000; ++i) { | |
9 | var o = {}; | |
10 | foo(o); | |
11 | if (o.f != 42) | |
12 | throw "Error: bad result: " + o.f; | |
13 | o = {f:23}; | |
14 | foo(o); | |
15 | if (o.f != 42) | |
16 | throw "Error: bad result: " + o.f; | |
17 | o = {g:12}; | |
18 | foo(o); | |
19 | if (o.f != 42) | |
20 | throw "Error: bad result: " + o.f; | |
21 | } | |
22 | ||
23 | var didThrow; | |
24 | try { | |
25 | var o = {}; | |
26 | Object.freeze(o); | |
27 | foo(o); | |
28 | } catch (e) { | |
29 | didThrow = e; | |
30 | } | |
31 | ||
32 | if (!didThrow || didThrow.toString().indexOf("TypeError:") != 0) | |
33 | throw "Error: didn't throw or threw wrong exception: " + didThrow; |