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.3_T1.js
blob23c0bf98aa512c2312cda06ca0b5a62fcdd1dc88
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 array element is undefined or null, use the empty string
6 esid: sec-array.prototype.join
7 description: Checking this use new Array() and []
8 ---*/
10 var x = [];
11 x[0] = undefined;
12 if (x.join() !== "") {
13   throw new Test262Error('#1: x = []; x[0] = undefined; x.join() === "". Actual: ' + (x.join()));
16 x = [];
17 x[0] = null;
18 if (x.join() !== "") {
19   throw new Test262Error('#2: x = []; x[0] = null; x.join() === "". Actual: ' + (x.join()));
22 x = Array(undefined, 1, null, 3);
23 if (x.join() !== ",1,,3") {
24   throw new Test262Error('#3: x = Array(undefined,1,null,3); x.join() === ",1,,3". Actual: ' + (x.join()));
27 reportCompare(0, 0);