Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2919703
weakset.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
541 B
Referenced Files
None
Subscribers
None
weakset.js
View Options
import
{
test
,
summary
}
from
'./helpers.js'
;
console
.
log
(
'WeakSet Tests\n'
);
const
ws
=
new
WeakSet
();
const
obj1
=
{};
const
obj2
=
{};
ws
.
add
(
obj1
);
ws
.
add
(
obj2
);
test
(
'weakset has true'
,
ws
.
has
(
obj1
),
true
);
test
(
'weakset has true 2'
,
ws
.
has
(
obj2
),
true
);
test
(
'weakset has false'
,
ws
.
has
({}),
false
);
ws
.
delete
(
obj1
);
test
(
'weakset delete'
,
ws
.
has
(
obj1
),
false
);
test
(
'weakset still has obj2'
,
ws
.
has
(
obj2
),
true
);
const
obj3
=
{
id
:
1
};
ws
.
add
(
obj3
);
ws
.
add
(
obj3
);
test
(
'weakset duplicate add'
,
ws
.
has
(
obj3
),
true
);
summary
();
File Metadata
Details
Attached
Mime Type
application/javascript
Expires
Fri, Mar 27, 4:19 AM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
512478
Default Alt Text
weakset.js (541 B)
Attached To
Mode
rANT Ant
Attached
Detach File
Event Timeline
Log In to Comment