1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
|
// |reftest| skip -- set-methods is not supported
// Copyright (C) 2023 Anthony Frehner and Kevin Gibbons. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-getsetrecord
description: GetSetRecord throws if obj is not an object
info: |
1. If obj is not an Object, throw a TypeError exception.
features: [set-methods]
---*/
let s1 = new Set([1]);
assert.throws(
TypeError,
function () {
s1.isSubsetOf(1);
},
"number"
);
assert.throws(
TypeError,
function () {
s1.isSubsetOf("");
},
"string"
);
assert.throws(
TypeError,
function () {
s1.isSubsetOf(1n);
},
"bigint"
);
assert.throws(
TypeError,
function () {
s1.isSubsetOf(false);
},
"boolean"
);
assert.throws(
TypeError,
function () {
s1.isSubsetOf(undefined);
},
"undefined"
);
assert.throws(
TypeError,
function () {
s1.isSubsetOf(null);
},
"null"
);
assert.throws(
TypeError,
function () {
s1.isSubsetOf(Symbol("test"));
},
"symbol"
);
reportCompare(0, 0);
|