1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
var thrown = false; try { x = [0]; for (var i = 0; i < 5; ++i) { if (i == 3) Object.freeze(x); else x.pop(); } } catch (e) { thrown = true; assertEq(e instanceof TypeError, true); } assertEq(thrown, true);