Skip to content

Commit 6b4a83c

Browse files
committed
Regression test of Set.prototype.size getter.
1 parent 2b663de commit 6b4a83c

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)