1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
function f(x) { return x["__proto__"] } var res = 0; for each(a in [{}, null]) { try { f(a); res += 20; } catch (e) { assertEq(e instanceof TypeError, true); assertEq(e.message.indexOf("is null") > 0, true); res += 50; } } assertEq(res, 70);