summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/staging/set-is-subset-on-set-like.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/staging/set-is-subset-on-set-like.js')
-rw-r--r--js/src/tests/test262/staging/set-is-subset-on-set-like.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/js/src/tests/test262/staging/set-is-subset-on-set-like.js b/js/src/tests/test262/staging/set-is-subset-on-set-like.js
new file mode 100644
index 0000000000..dac869b822
--- /dev/null
+++ b/js/src/tests/test262/staging/set-is-subset-on-set-like.js
@@ -0,0 +1,27 @@
+// |reftest| skip -- set-methods is not supported
+// Copyright (C) 2023 the V8 project authors. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+/*---
+description: Test isSubsetOf set method on a set like with equal size.
+features: [set-methods]
+---*/
+
+const SetLike = {
+ arr: [42, 44, 45],
+ size: 3,
+ keys() {
+ return this.arr[Symbol.iterator]();
+ },
+ has(key) {
+ return this.arr.indexOf(key) != -1;
+ }
+};
+
+const firstSet = new Set();
+firstSet.add(42);
+firstSet.add(43);
+firstSet.add(45);
+
+assert.sameValue(firstSet.isSubsetOf(SetLike), false);
+
+reportCompare(0, 0);