keith_miller@apple.com | d1a5d2f | 2016-05-02 17:38:15 +0000 | [diff] [blame] | 1 | function test() { |
2 | return this.f; | ||||
3 | } | ||||
4 | noInline(test); | ||||
5 | |||||
6 | function test2() { | ||||
7 | "use strict"; | ||||
8 | return this.f; | ||||
9 | } | ||||
10 | noInline(test2); | ||||
11 | |||||
12 | f = 42; | ||||
13 | |||||
14 | let get = eval; | ||||
15 | let global = get("this"); | ||||
16 | |||||
17 | for (var i = 0; i < 10000; ++i) { | ||||
18 | let result = test.call(global); | ||||
19 | if (result !== 42) | ||||
20 | throw new Error("bad this value: " + result); | ||||
21 | |||||
22 | result = test2.call(global); | ||||
23 | if (result !== 42) | ||||
24 | throw new Error("bad this value: " + result); | ||||
25 | } |