We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b663de commit 6b4a83cCopy full SHA for 6b4a83c
graal-js/src/com.oracle.truffle.js.test/js/GR-45497.js
@@ -0,0 +1,18 @@
1
+/*
2
+ * Copyright (c) 2023, 2023, Oracle and/or its affiliates. All rights reserved.
3
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
+ *
5
+ * Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
6
+ */
7
+
8
+/**
9
+ * Regression test of Set.prototype.size getter.
10
11
12
+load("assert.js");
13
14
+const sizeOfThisSet = Object.getOwnPropertyDescriptor(Set.prototype, 'size').get;
15
16
+assertThrows(() => sizeOfThisSet.call({}), TypeError);
17
+assertSame(0, sizeOfThisSet.call(new Set()));
18
+assertThrows(() => sizeOfThisSet.call(new Map()), TypeError);
0 commit comments