Bug 1892041 - Part 2: Update test262. r=spidermonkey-reviewers,dminor
[gecko.git] / js / src / tests / test262 / built-ins / Array / prototype / join / S15.4.4.5_A1.2_T2.js
blobbea80dc36e836faa50aa4355a149d810199ae88d
1 // Copyright 2009 the Sputnik authors.  All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
4 /*---
5 info: If separator is undefined, a single comma is used as the separator
6 esid: sec-array.prototype.join
7 description: Checking this use new Array() and []
8 ---*/
10 var x = new Array(0, 1, 2, 3);
11 if (x.join(undefined) !== "0,1,2,3") {
12   throw new Test262Error('#1: x = new Array(0,1,2,3); x.join(undefined) === "0,1,2,3". Actual: ' + (x.join(undefined)));
15 x = [];
16 x[0] = 0;
17 x[3] = 3;
18 if (x.join(undefined) !== "0,,,3") {
19   throw new Test262Error('#2: x = []; x[0] = 0; x[3] = 3; x.join(undefined) === "0,,,3". Actual: ' + (x.join(undefined)));
22 x = [];
23 x[0] = 0;
24 if (x.join(undefined) !== "0") {
25   throw new Test262Error('#3: x = []; x[0] = 0; x.join(undefined) === "0". Actual: ' + (x.join(undefined)));
28 reportCompare(0, 0);