summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/join/S15.4.4.5_A1.1_T1.js
blob: 3e9b0a1777a0ae1474a6f5e8e185adf66ce68e2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2009 the Sputnik authors.  All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
info: If length is zero, return the empty string
esid: sec-array.prototype.join
es5id: 15.4.4.5_A1.1_T1
description: Checking this use new Array() and []
---*/

//CHECK#1
var x = new Array();
if (x.join() !== "") {
  $ERROR('#1: x = new Array(); x.join() === "". Actual: ' + (x.join()));
}

//CHECK#2
x = [];
x[0] = 1;
x.length = 0;
if (x.join() !== "") {
  $ERROR('#2: x = []; x[0] = 1; x.length = 0; x.join() === "". Actual: ' + (x.join()));
}