summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/prototype/flat/positive-infinity.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/prototype/flat/positive-infinity.js')
-rw-r--r--js/src/tests/test262/built-ins/Array/prototype/flat/positive-infinity.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/prototype/flat/positive-infinity.js b/js/src/tests/test262/built-ins/Array/prototype/flat/positive-infinity.js
new file mode 100644
index 0000000000..7725c595c1
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Array/prototype/flat/positive-infinity.js
@@ -0,0 +1,14 @@
+// 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 positive infinity, the depthNum is max depth of the array
+includes: [compareArray.js]
+features: [Array.prototype.flat]
+---*/
+
+var a = [1, [2, [3, [4]]]]
+assert.compareArray(a.flat(Number.POSITIVE_INFINITY), [1, 2, 3, 4], 'a.flat(Number.POSITIVE_INFINITY) must return [1, 2, 3, 4]');
+
+reportCompare(0, 0);