summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/flat/symbol-object-create-null-depth-throws.js
blob: a84a154d6a23a54b10af3d217403b4c58d9c768c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// 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.flat
description: >
    if the argument is a Symbol or Object null, it throws exception
features: [Array.prototype.flat]
---*/

assert.sameValue(typeof Array.prototype.flat, 'function');

assert.throws(TypeError, function() {
  [].flat(Symbol());
}, 'symbol value');

assert.throws(TypeError, function() {
  [].flat(Object.create(null));
}, 'object create null');

reportCompare(0, 0);