blob: e4d7c9a50d364363caaf86c97f2387e2ceb6591a [file] [log] [blame]
function foo(thingy) {
if (thingy.length === void 0 || thingy.charAt !== void 0)
return "yes";
return "no";
}
noInline(foo);
function test(object, expected) {
var result = foo(object);
if (result != expected)
throw new Error("Bad result: " + result);
}
for (var i = 0; i < 1000; ++i) {
test({}, "yes");
test([], "no");
test("hello", "yes");
test((function(){return arguments;})(), "no");
var array = [];
for (var j = 0; j < 100; ++j) {
test(array, "no");
array.push(42);
}
}