summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Tuple/prototype/toSorted/this-is-not-tuple.js
blob: 3d1761f08f222626bf701c0b9dce98cf5e112b30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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);