1# Copyright (c) 2023 Shenzhen Kaihong Digital Industry Development Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14weakmapsymbolkey test start
15TypeError
16wm.has(s1) true
17wm.get(s1) 1
18wm.delete(s1) true
19wm.has(s1) false
20wm.has(s2) false
21wm.get(s2) undefined
22wm.delete(s2) false
23wm.get(Symbol.match) == 4 true
24weakmapsymbolkey test end
25weaksetsymbolvalue test start
26TypeError
27ws.has(sym1) true
28ws.delete(sym1) true
29ws.has(sym1) false
30ws.has(sym2) false
31ws.delete(sym2) false
32ws.has(Symbol.match) true
33weaksetsymbolvalue test end
34weakrefforsymbol test start
35TypeError
36wr1.deref() == target1 true
370 wr.deref() == ctor true
381 wr.deref() == ctor true
392 wr.deref() == ctor true
403 wr.deref() == ctor true
414 wr.deref() == ctor true
425 wr.deref() == ctor true
436 wr.deref() == ctor true
447 wr.deref() == ctor true
458 wr.deref() == ctor true
469 wr.deref() == ctor true
4710 wr.deref() == ctor true
4811 wr.deref() == ctor true
4912 wr.deref() == ctor true
50weakrefforsymbol test end
51finalizationregistrywithsymbol test start
52TypeError
53finalizationregistrywithsymbol test end
54symbol 2 destroyed
55