]>
Commit | Line | Data |
---|---|---|
81345200 A |
1 | function foo(thingy) { |
2 | if (thingy.length === void 0 || thingy.charAt !== void 0) | |
3 | return "yes"; | |
4 | return "no"; | |
5 | } | |
6 | ||
7 | noInline(foo); | |
8 | ||
9 | function test(object, expected) { | |
10 | var result = foo(object); | |
11 | if (result != expected) | |
12 | throw new Error("Bad result: " + result); | |
13 | } | |
14 | ||
15 | for (var i = 0; i < 1000; ++i) { | |
16 | test({}, "yes"); | |
17 | test([], "no"); | |
18 | test("hello", "yes"); | |
19 | test((function(){return arguments;})(), "no"); | |
20 | var array = []; | |
21 | for (var j = 0; j < 100; ++j) { | |
22 | test(array, "no"); | |
23 | array.push(42); | |
24 | } | |
25 | } |