]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo() { |
2 | return this.f; | |
3 | } | |
4 | ||
5 | noInline(foo); | |
6 | ||
7 | String.prototype.f = 43; | |
8 | String.prototype.g = foo; | |
9 | Number.prototype.f = 78; | |
10 | Number.prototype.g = foo; | |
11 | ||
12 | for (var i = 0; i < 100000; ++i) { | |
13 | var o = {f:foo}; | |
14 | var result = o.f(); | |
15 | if (result != foo) | |
16 | throw "Error: bad object result: " + result; | |
17 | o = "hello"; | |
18 | result = o.g(); | |
19 | if (result != 43) | |
20 | throw "Error: bad string result: " + result; | |
21 | o = 42; | |
22 | result = o.g(); | |
23 | if (result != 78) | |
24 | throw "Error: bad number result: " + result; | |
25 | } |