JavaScriptCore-7601.1.46.3.tar.gz
[apple/javascriptcore.git] / tests / stress / is-undefined-masquerader.js
CommitLineData
81345200
A
1function foo(o) {
2 return typeof o === "undefined";
3}
4
5noInline(foo);
6
7function test(o, expected) {
8 var result = foo(o);
9 if (result != expected)
10 throw new Error("bad result: " + result);
11}
12
13for (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}