summaryrefslogtreecommitdiff
path: root/test/built-ins/Array/prototype/flatten/empty-array-elements.js
blob: cbf2ae4b07b01ae22c8cd893998e25a702282da7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright (C) 2018 Shilpi Jain and Michael Ficarra. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-array.prototype.flatten
description: >
    arrays with empty arrays elements
includes: [compareArray.js]
features: [Array.prototype.flatten]
---*/

var a = {};
assert.compareArray([].flatten(), []);
assert.compareArray([[], []].flatten(), []);
assert.compareArray([[], [1]].flatten(), [1]);
assert.compareArray([[], [1, a]].flatten(), [1, a]);