summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Iterator/prototype/reduce/left-associative.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/Iterator/prototype/reduce/left-associative.js')
-rw-r--r--js/src/tests/non262/Iterator/prototype/reduce/left-associative.js7
1 files changed, 7 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/reduce/left-associative.js b/js/src/tests/non262/Iterator/prototype/reduce/left-associative.js
new file mode 100644
index 0000000000..a6208504b6
--- /dev/null
+++ b/js/src/tests/non262/Iterator/prototype/reduce/left-associative.js
@@ -0,0 +1,7 @@
+// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally
+
+assertEq([1, 2, 3].values().reduce((x, y) => `(${x}+${y})`, 0), '(((0+1)+2)+3)');
+assertEq([1, 2, 3].values().reduce((x, y) => `(${x}+${y})`), '((1+2)+3)');
+
+if (typeof reportCompare === 'function')
+ reportCompare(0, 0);