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_T1.js
blob4107dafdb2da339bb490b47df1e4163663f5b9ce
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() !== "0,1,2,3") {
12   throw new Test262Error('#1: x = new Array(0,1,2,3); x.join() === "0,1,2,3". Actual: ' + (x.join()));
15 x = [];
16 x[0] = 0;
17 x[3] = 3;
18 if (x.join() !== "0,,,3") {
19   throw new Test262Error('#2: x = []; x[0] = 0; x[3] = 3; x.join() === "0,,,3". Actual: ' + (x.join()));
22 x = [];
23 x[0] = 0;
24 if (x.join() !== "0") {
25   throw new Test262Error('#3: x = []; x[0] = 0; x.join() === "0". Actual: ' + (x.join()));
28 reportCompare(0, 0);