summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/prototype/toSorted/comparefn-call-throws.js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--js/src/tests/non262/Tuple/prototype/toSorted/comparefn-call-throws.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/js/src/tests/non262/Tuple/prototype/toSorted/comparefn-call-throws.js b/js/src/tests/non262/Tuple/prototype/toSorted/comparefn-call-throws.js
new file mode 100644
index 0000000000..4442b0d3d5
--- /dev/null
+++ b/js/src/tests/non262/Tuple/prototype/toSorted/comparefn-call-throws.js
@@ -0,0 +1,16 @@
+// |reftest| skip-if(!this.hasOwnProperty("Tuple"))
+let sample = #[42, 43, 44, 45, 46];
+var calls = 0;
+
+let comparefn = function() {
+ calls += 1;
+ throw new TypeError();
+};
+
+assertThrowsInstanceOf(function() {
+ sample.toSorted(comparefn);
+}, TypeError, "comparefn should throw");
+
+assertEq(calls, 1);
+
+reportCompare(0, 0);