Skip to content
Snippets Groups Projects
Commit d7446f81 authored by JaimeLynSchatz's avatar JaimeLynSchatz
Browse files

change assert to not assume a sorted list of arguments indices for Bugzilla 1159

parent 9b669da6
Branches
No related tags found
No related merge requests found
......@@ -12,19 +12,19 @@ function testcase() {
function testArgs2(x, y, z) {
// Properties of the arguments object are enumerable.
var a = Object.keys(arguments);
if (a.length === 2 && a[0] === "0" && a[1] === "1")
if (a.length === 2 && a[0] in arguments && a[1] in arguments)
return true;
}
function testArgs3(x, y, z) {
// Properties of the arguments object are enumerable.
var a = Object.keys(arguments);
if (a.length === 3 && a[0] === "0" && a[1] === "1" && a[2] === "2")
if (a.length === 3 && a[0] in arguments && a[1] in arguments && a[2] in arguments)
return true;
}
function testArgs4(x, y, z) {
// Properties of the arguments object are enumerable.
var a = Object.keys(arguments);
if (a.length === 4 && a[0] === "0" && a[1] === "1" && a[2] === "2" && a[3] === "3")
if (a.length === 4 && a[0] in arguments && a[1] in arguments && a[2] in arguments && a[3] in arguments)
return true;
}
return testArgs2(1, 2) && testArgs3(1, 2, 3) && testArgs4(1, 2, 3, 4);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment