]> git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/is-undefined-masquerader.js
JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / is-undefined-masquerader.js
1 function foo(o) {
2 return typeof o === "undefined";
3 }
4
5 noInline(foo);
6
7 function test(o, expected) {
8 var result = foo(o);
9 if (result != expected)
10 throw new Error("bad result: " + result);
11 }
12
13 for (var i = 0; i < 10000; ++i) {
14 test(void 0, true);
15 test(null, false);
16 test(42, false);
17 test({}, false);
18 test("undefined", false);
19 test(makeMasquerader(), true);
20 }