diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/Tuple/prototype/toSorted/this-is-not-tuple.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/js/src/tests/non262/Tuple/prototype/toSorted/this-is-not-tuple.js b/js/src/tests/non262/Tuple/prototype/toSorted/this-is-not-tuple.js new file mode 100644 index 0000000000..3d1761f08f --- /dev/null +++ b/js/src/tests/non262/Tuple/prototype/toSorted/this-is-not-tuple.js @@ -0,0 +1,21 @@ +// |reftest| skip-if(!this.hasOwnProperty("Tuple")) +var withSorted = Tuple.prototype.withSorted; + +var thisVals = [[undefined, "undefined"], + [null, "null"], + [42, "42"], + ["1", "1"], + [true, "true"], + [false, "false"], + [Symbol("s"), "Symbol(\"s\")"], + [[], "[]"], + [{}, "{}"]]; + +for (pair of thisVals) { + thisVal = pair[0]; + errorMsg = "this is: " + pair[1]; + assertThrowsInstanceOf(() => withSorted.call(thisVal), + TypeError, errorMsg); +} + +reportCompare(0, 0); |