1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
var ToObject = getSelfHostedValue("ToObject"); function f(arr) { for (var i = 0; i < arr.length; i++) { var v = arr[i]; try { var x = 1; ToObject({}); x = 2; ToObject(v); } catch (e) { assertEq(x, 2); } } } var a = []; for (var i = 0; i < 50; i++) { a.push({}, null); } f(a);