1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
var c = 0; for (var i = 0; i < 5; i++) { try { Object.defineProperty([], "length", { configurable: true, enumerable: true, writable: true, value: 0 }); } catch (e) { assertEq(e instanceof TypeError, true); c++; } } assertEq(c, i);