archives

« Bugzilla Issues Index

#275 — ch15/15.4/15.4.4/15.4.4.4/15.4.4.4-5-c-i-1.js asserting incorrect behavior


This test creates a new Array object by calling concat, passing the umber 101 as the this value to the call.

The error in the test is that it ignores step 1 from the spec, "Let O be the result of calling ToObject passing the this value as the argument."

The this value should always be converted to an object, before being added into the result array. (O, the converted object is added to List in step 4, extracted as E in step 5.a, and added to the result array in step 5.c.i).

The test checks the result array incorrectly twice:
var instanceOfVerify = typeof newArr[0]==="number";
this should read:
var instanceOfVerify = typeof newArr[0]==="object";
And:
verifyValue = newArr[0] === 101;
this should read:
verifyValue = newArr[0] == 101;




*** This bug has been marked as a duplicate of bug 270 ***