archives

« Bugzilla Issues Index

#28 — S15.3.4.3_A6_T1.js is invalid (ES5 to ES5.1 change)


The test case consists of the following:
try {
Function().apply(1,{});
$FAIL('#1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown');
} catch (e) {
if (!(e instanceof TypeError)) {
$ERROR('#1.1: if argArray is neither an array nor an arguments object (see 10.1.8), a TypeError exception is thrown');
}
}

which expect Function.prototype.apply to fail as '{}' is not an array or arguments object. The interesting thing here is this test was still valid up until ES5.1 was released. You see, ES5 still had a restriction that the second param to apply must have a 'length' property. This restriction was removed in ES5.1 though (see steps 4 and 5 of 15.3.4.3: ToUin32(undefined) is 0).


S15.3.4.3_A6_T4.js has the same issue.


Fixed at http://hg.ecmascript.org/tests/test262/rev/3990187a1534