Skip to content

Commit

Permalink
Replace checks in old tests with assert.sameValue
Browse files Browse the repository at this point in the history
Many old tests use custom checks with if and throwing a custom error instead of using `assert.sameValue`, this replaces most cases.
  • Loading branch information
CanadaHonk committed Jul 11, 2023
1 parent 8ce9864 commit dc5be8d
Show file tree
Hide file tree
Showing 807 changed files with 2,821 additions and 8,217 deletions.
16 changes: 4 additions & 12 deletions test/built-ins/Array/property-cast-number.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,15 @@ assert.sameValue(x["4294967296"], 1, 'The value of x["4294967296"] is expected t

var y = [];
y[4294967297] = 1;
if (y[1] !== undefined) {
throw new Test262Error('#3: y = []; y[4294967297] = 1; y[1] === undefined. Actual: ' + (y[1]));
}
assert.sameValue(y[1], undefined, '#3: y = []; y[4294967297] = 1; y[1] === undefined');

//CHECK#4
if (y["4294967297"] !== 1) {
throw new Test262Error('#4: y = []; y[4294967297] = 1; y["4294967297"] === 1. Actual: ' + (y["4294967297"]));
}
assert.sameValue(y["4294967297"], 1, '#4: y = []; y[4294967297] = 1; y["4294967297"] === 1');

//CHECK#5
var z = [];
z[1.1] = 1;
if (z[1] !== undefined) {
throw new Test262Error('#5: z = []; z[1.1] = 1; z[1] === undefined. Actual: ' + (z[1]));
}
assert.sameValue(z[1], undefined, '#5: z = []; z[1.1] = 1; z[1] === undefined');

//CHECK#6
if (z["1.1"] !== 1) {
throw new Test262Error('#6: z = []; z[1.1] = 1; z["1.1"] === 1. Actual: ' + (z["1.1"]));
}
assert.sameValue(z["1.1"], 1, '#6: z = []; z[1.1] = 1; z["1.1"] === 1');
8 changes: 2 additions & 6 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A1.1_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@ description: Checking this use new Array() and []
---*/

var x = new Array();
if (x.join() !== "") {
throw new Test262Error('#1: x = new Array(); x.join() === "". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "", '#1: x = new Array(); x.join() === ""');

x = [];
x[0] = 1;
x.length = 0;
if (x.join() !== "") {
throw new Test262Error('#2: x = []; x[0] = 1; x.length = 0; x.join() === "". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "", '#2: x = []; x[0] = 1; x.length = 0; x.join() === ""');
12 changes: 3 additions & 9 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ description: Checking this use new Array() and []
---*/

var x = new Array(0, 1, 2, 3);
if (x.join() !== "0,1,2,3") {
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "0,1,2,3", '#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3"');

x = [];
x[0] = 0;
x[3] = 3;
if (x.join() !== "0,,,3") {
throw new Test262Error('#2: x = []; x[0] = 0; x[3] = 3; x.join() === "0,,,3". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "0,,,3", '#2: x = []; x[0] = 0; x[3] = 3; x.join() === "0,,,3"');

x = [];
x[0] = 0;
if (x.join() !== "0") {
throw new Test262Error('#3: x = []; x[0] = 0; x.join() === "0". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "0", '#3: x = []; x[0] = 0; x.join() === "0"');
12 changes: 3 additions & 9 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A1.2_T2.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,13 @@ description: Checking this use new Array() and []
---*/

var x = new Array(0, 1, 2, 3);
if (x.join(undefined) !== "0,1,2,3") {
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
}
assert.sameValue(x.join(undefined), "0,1,2,3", '#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3"');

x = [];
x[0] = 0;
x[3] = 3;
if (x.join(undefined) !== "0,,,3") {
throw new Test262Error('#2: x = []; x[0] = 0; x[3] = 3; x.join(undefined) === "0,,,3". Actual: ' + (x.join(undefined)));
}
assert.sameValue(x.join(undefined), "0,,,3", '#2: x = []; x[0] = 0; x[3] = 3; x.join(undefined) === "0,,,3"');

x = [];
x[0] = 0;
if (x.join(undefined) !== "0") {
throw new Test262Error('#3: x = []; x[0] = 0; x.join(undefined) === "0". Actual: ' + (x.join(undefined)));
}
assert.sameValue(x.join(undefined), "0", '#3: x = []; x[0] = 0; x.join(undefined) === "0"');
12 changes: 3 additions & 9 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A1.3_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,11 @@ description: Checking this use new Array() and []

var x = [];
x[0] = undefined;
if (x.join() !== "") {
throw new Test262Error('#1: x = []; x[0] = undefined; x.join() === "". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "", '#1: x = []; x[0] = undefined; x.join() === ""');

x = [];
x[0] = null;
if (x.join() !== "") {
throw new Test262Error('#2: x = []; x[0] = null; x.join() === "". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "", '#2: x = []; x[0] = null; x.join() === ""');

x = Array(undefined, 1, null, 3);
if (x.join() !== ",1,,3") {
throw new Test262Error('#3: x = Array(undefined,1,null,3); x.join() === ",1,,3". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), ",1,,3", '#3: x = Array(undefined,1,null,3); x.join() === ",1,,3"');
16 changes: 4 additions & 12 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A2_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,11 @@ if (obj.length !== undefined) {
}

obj.length = undefined;
if (obj.join() !== "") {
throw new Test262Error('#3: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join() === ". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), "", '#3: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join() === "');

if (obj.length !== undefined) {
throw new Test262Error('#4: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join(); obj.length === undefined. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, undefined, '#4: var obj = {}; obj.length = undefined; obj.join = Array.prototype.join; obj.join(); obj.length === undefined');

obj.length = null
if (obj.join() !== "") {
throw new Test262Error('#5: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), "", '#5: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join() === ""');

if (obj.length !== null) {
throw new Test262Error('#6: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join(); obj.length === null. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, null, '#6: var obj = {}; obj.length = null; obj.join = Array.prototype.join; obj.join(); obj.length === null');
32 changes: 8 additions & 24 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A2_T2.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,25 +13,17 @@ var obj = {};
obj.join = Array.prototype.join;

obj.length = NaN;
if (obj.join() !== "") {
throw new Test262Error('#1: var obj = {}; obj.length = NaN; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), "", '#1: var obj = {}; obj.length = NaN; obj.join = Array.prototype.join; obj.join() === ""');

assert.sameValue(obj.length, NaN, "obj.length is NaN");

obj.length = Number.NEGATIVE_INFINITY;
if (obj.join() !== "") {
throw new Test262Error('#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), "", '#5: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join() === ""');

if (obj.length !== Number.NEGATIVE_INFINITY) {
throw new Test262Error('#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join(); obj.length === Number.NEGATIVE_INFINITY. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, Number.NEGATIVE_INFINITY, '#6: var obj = {}; obj.length = Number.NEGATIVE_INFINITY; obj.join = Array.prototype.join; obj.join(); obj.length === Number.NEGATIVE_INFINITY');

obj.length = -0;
if (obj.join() !== "") {
throw new Test262Error('#7: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), "", '#7: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join() === ""');

if (obj.length !== -0) {
throw new Test262Error('#8: var obj = {}; obj.length = -0; obj.join = Array.prototype.join; obj.join(); obj.length === 0. Actual: ' + (obj.length));
Expand All @@ -42,20 +34,12 @@ if (obj.length !== -0) {
}

obj.length = 0.5;
if (obj.join() !== "") {
throw new Test262Error('#9: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), "", '#9: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join() === ""');

if (obj.length !== 0.5) {
throw new Test262Error('#10: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join(); obj.length === 0.5. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, 0.5, '#10: var obj = {}; obj.length = 0.5; obj.join = Array.prototype.join; obj.join(); obj.length === 0.5');

var x = new Number(0);
obj.length = x;
if (obj.join() !== "") {
throw new Test262Error('#11: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join() === "". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), "", '#11: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join() === ""');

if (obj.length !== x) {
throw new Test262Error('#12: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, x, '#12: var x = new Number(0); var obj = {}; obj.length = x; obj.join = Array.prototype.join; obj.join(); obj.length === x');
24 changes: 6 additions & 18 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A2_T3.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,25 @@ var obj = {};
obj.join = Array.prototype.join;

obj.length = 4.5;
if (obj.join() !== ",,,") {
throw new Test262Error('#1: var obj = {}; obj.length = 4.5; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), ",,,", '#1: var obj = {}; obj.length = 4.5; obj.join = Array.prototype.join; obj.join() === ",,,"');

obj[0] = undefined;
obj[1] = 1;
obj[2] = null;
if (obj.join() !== ",1,,") {
throw new Test262Error('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), ",1,,", '#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,"');

if (obj.length !== 4.5) {
throw new Test262Error('#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === 4.5. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, 4.5, '#1: var obj = {}; obj.length = 4.5; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === 4.5');

var obj = {};
obj.join = Array.prototype.join;

var x = new Number(4.5);
obj.length = x;
if (obj.join() !== ",,,") {
throw new Test262Error('#4: var obj = {}; var x = new Number(4.5); obj.length = x; obj.join = Array.prototype.join; obj.join() === ",,,". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), ",,,", '#4: var obj = {}; var x = new Number(4.5); obj.length = x; obj.join = Array.prototype.join; obj.join() === ",,,"');

obj[0] = undefined;
obj[1] = 1;
obj[2] = null;
if (obj.join() !== ",1,,") {
throw new Test262Error('#5: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,". Actual: ' + (obj.join()));
}
assert.sameValue(obj.join(), ",1,,", '#5: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join() === ",1,,"');

if (obj.length !== x) {
throw new Test262Error('#6: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === x. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, x, '#6: var obj = {}; var x = new Number(4.5); obj.length = x; obj[0] = undefined; obj[1] = 1; obj[2] = null; obj.join = Array.prototype.join; obj.join(); obj.length === x');
32 changes: 8 additions & 24 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A3.1_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,19 @@ description: >
---*/

var x = new Array(0, 1, 2, 3);
if (x.join("") !== "0123") {
throw new Test262Error('#0: x = new Array(0,1,2,3); x.join("") === "0123". Actual: ' + (x.join("")));
}
assert.sameValue(x.join(""), "0123", '#0: x = new Array(0,1,2,3); x.join("") === "0123"');

x = new Array(0, 1, 2, 3);
if (x.join("\\") !== "0\\1\\2\\3") {
throw new Test262Error('#1: x = new Array(0,1,2,3); x.join("\\") === "0\\1\\2\\3". Actual: ' + (x.join("\\")));
}
assert.sameValue(x.join("\\"), "0\\1\\2\\3", '#1: x = new Array(0,1,2,3); x.join("\\") === "0\\1\\2\\3"');

if (x.join("&") !== "0&1&2&3") {
throw new Test262Error('#2: x = new Array(0,1,2,3); x.join("&") === "0&1&2&3". Actual: ' + (x.join("&")));
}
assert.sameValue(x.join("&"), "0&1&2&3", '#2: x = new Array(0,1,2,3); x.join("&") === "0&1&2&3"');

if (x.join(true) !== "0true1true2true3") {
throw new Test262Error('#3: x = new Array(0,1,2,3); x.join(true) === "0true1true2true3". Actual: ' + (x.join(true)));
}
assert.sameValue(x.join(true), "0true1true2true3", '#3: x = new Array(0,1,2,3); x.join(true) === "0true1true2true3"');

if (x.join(Infinity) !== "0Infinity1Infinity2Infinity3") {
throw new Test262Error('#4: x = new Array(0,1,2,3); x.join(Infinity) === "0Infinity1Infinity2Infinity3". Actual: ' + (x.join(Infinity)));
}
assert.sameValue(x.join(Infinity), "0Infinity1Infinity2Infinity3", '#4: x = new Array(0,1,2,3); x.join(Infinity) === "0Infinity1Infinity2Infinity3"');

if (x.join(null) !== "0null1null2null3") {
throw new Test262Error('#3: 5 = new Array(0,1,2,3); x.join(null) === "0null1null2null3". Actual: ' + (x.join(null)));
}
assert.sameValue(x.join(null), "0null1null2null3", '#3: 5 = new Array(0,1,2,3); x.join(null) === "0null1null2null3"');

if (x.join(undefined) !== "0,1,2,3") {
throw new Test262Error('#6: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
}
assert.sameValue(x.join(undefined), "0,1,2,3", '#6: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3"');

if (x.join(NaN) !== "0NaN1NaN2NaN3") {
throw new Test262Error('#7: x = new Array(0,1,2,3); x.join(NaN) === "0NaN1NaN2NaN3". Actual: ' + (x.join(NaN)));
}
assert.sameValue(x.join(NaN), "0NaN1NaN2NaN3", '#7: x = new Array(0,1,2,3); x.join(NaN) === "0NaN1NaN2NaN3"');
32 changes: 8 additions & 24 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A3.2_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,25 @@ description: >
---*/

var x = new Array("", "", "");
if (x.join("") !== "") {
throw new Test262Error('#0: var x = new Array("","",""); x.join("") === "". Actual: ' + (x.join("")));
}
assert.sameValue(x.join(""), "", '#0: var x = new Array("","",""); x.join("") === ""');

var x = new Array("\\", "\\", "\\");
if (x.join("\\") !== "\\\\\\\\\\") {
throw new Test262Error('#1: var x = new Array("\\","\\","\\"); x.join("\\") === "\\\\\\\\\\". Actual: ' + (x.join("\\")));
}
assert.sameValue(x.join("\\"), "\\\\\\\\\\", '#1: var x = new Array("\\","\\","\\"); x.join("\\") === "\\\\\\\\\\"');

var x = new Array("&", "&", "&");
if (x.join("&") !== "&&&&&") {
throw new Test262Error('#2: var x = new Array("&", "&", "&"); x.join("&") === "&&&&&". Actual: ' + (x.join("&")));
}
assert.sameValue(x.join("&"), "&&&&&", '#2: var x = new Array("&", "&", "&"); x.join("&") === "&&&&&"');

var x = new Array(true, true, true);
if (x.join() !== "true,true,true") {
throw new Test262Error('#3: var x = new Array(true,true,true); x.join(true,true,true) === "true,true,true". Actual: ' + (x.join(true, true, true)));
}
assert.sameValue(x.join(), "true,true,true", '#3: var x = new Array(true,true,true); x.join(true,true,true) === "true,true,true"');

var x = new Array(null, null, null);
if (x.join() !== ",,") {
throw new Test262Error('#4: var x = new Array(null,null,null); x.join(null,null,null) === ",,". Actual: ' + (x.join(null, null, null)));
}
assert.sameValue(x.join(), ",,", '#4: var x = new Array(null,null,null); x.join(null,null,null) === ",,"');

var x = new Array(undefined, undefined, undefined);
if (x.join() !== ",,") {
throw new Test262Error('#5: var x = new Array(undefined,undefined,undefined); x.join(undefined,undefined,undefined) === ",,". Actual: ' + (x.join(undefined, undefined, undefined)));
}
assert.sameValue(x.join(), ",,", '#5: var x = new Array(undefined,undefined,undefined); x.join(undefined,undefined,undefined) === ",,"');

var x = new Array(Infinity, Infinity, Infinity);
if (x.join() !== "Infinity,Infinity,Infinity") {
throw new Test262Error('#6: var x = new Array(Infinity,Infinity,Infinity); x.join(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity". Actual: ' + (x.join(Infinity, Infinity, Infinity)));
}
assert.sameValue(x.join(), "Infinity,Infinity,Infinity", '#6: var x = new Array(Infinity,Infinity,Infinity); x.join(Infinity,Infinity,Infinity) === "Infinity,Infinity,Infinity"');

var x = new Array(NaN, NaN, NaN);
if (x.join() !== "NaN,NaN,NaN") {
throw new Test262Error('#7: var x = new Array(NaN,NaN,NaN); x.join(NaN,NaN,NaN) === "NaN,NaN,NaN". Actual: ' + (x.join(NaN, NaN, NaN)));
}
assert.sameValue(x.join(), "NaN,NaN,NaN", '#7: var x = new Array(NaN,NaN,NaN); x.join(NaN,NaN,NaN) === "NaN,NaN,NaN"');
8 changes: 2 additions & 6 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A4_T3.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ obj[1] = "y";
obj[2] = "z";
obj.length = -4294967294;

if (obj.join("") !== "") {
throw new Test262Error('#1: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join("") === "". Actual: ' + (obj.join("")));
}
assert.sameValue(obj.join(""), "", '#1: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join("") === ""');

if (obj.length !== -4294967294) {
throw new Test262Error('#2: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join(""); obj.length === -4294967294. Actual: ' + (obj.length));
}
assert.sameValue(obj.length, -4294967294, '#2: var obj = {}; obj.join = Array.prototype.join; obj[0] = "x"; obj[1] = "y"; obj[2] = "z"; obj.length = -4294967294; obj.join(""); obj.length === -4294967294');
8 changes: 2 additions & 6 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A5_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,12 @@ description: >
Array.prototype[1] = 1;
var x = [0];
x.length = 2;
if (x.join() !== "0,1") {
throw new Test262Error('#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "0,1", '#1: Array.prototype[1] = 1; x = [0]; x.length = 2; x.join() === "0,1"');

Object.prototype[1] = 1;
Object.prototype.length = 2;
Object.prototype.join = Array.prototype.join;
x = {
0: 0
};
if (x.join() !== "0,1") {
throw new Test262Error('#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1". Actual: ' + (x.join()));
}
assert.sameValue(x.join(), "0,1", '#2: Object.prototype[1] = 1; Object.prototype.length = 2; Object.prototype.join = Array.prototype.join; x = {0:0}; x.join() === "0,1"');
4 changes: 1 addition & 3 deletions test/built-ins/Array/prototype/join/S15.4.4.5_A6.6.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@ esid: sec-array.prototype.join
description: Checking Array.prototype.join.prototype
---*/

if (Array.prototype.join.prototype !== undefined) {
throw new Test262Error('#1: Array.prototype.join.prototype === undefined. Actual: ' + (Array.prototype.join.prototype));
}
assert.sameValue(Array.prototype.join.prototype, undefined, '#1: Array.prototype.join.prototype === undefined');
16 changes: 4 additions & 12 deletions test/built-ins/Array/prototype/pop/S15.4.4.6_A1.1_T1.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,13 @@ description: Checking this algorithm

var x = new Array();
var pop = x.pop();
if (pop !== undefined) {
throw new Test262Error('#1: var x = new Array(); x.pop() === undefined. Actual: ' + (pop));
}
assert.sameValue(pop, undefined, '#1: var x = new Array(); x.pop() === undefined');

if (x.length !== 0) {
throw new Test262Error('#2: var x = new Array(); x.pop(); x.length === 0. Actual: ' + (x.length));
}
assert.sameValue(x.length, 0, '#2: var x = new Array(); x.pop(); x.length === 0');

var x = Array(1, 2, 3);
x.length = 0;
var pop = x.pop();
if (pop !== undefined) {
throw new Test262Error('#2: var x = Array(1,2,3); x.length = 0; x.pop() === undefined. Actual: ' + (pop));
}
assert.sameValue(pop, undefined, '#2: var x = Array(1,2,3); x.length = 0; x.pop() === undefined');

if (x.length !== 0) {
throw new Test262Error('#4: var x = new Array(1,2,3); x.length = 0; x.pop(); x.length === 0. Actual: ' + (x.length));
}
assert.sameValue(x.length, 0, '#4: var x = new Array(1,2,3); x.length = 0; x.pop(); x.length === 0');
Loading

0 comments on commit dc5be8d

Please sign in to comment.