summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/test/mochitest/doc_map-set.html
blob: 7c2c624e14a0fa58444775e036559b479f4a9f4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!-- Any copyright is dedicated to the Public Domain.
     http://creativecommons.org/publicdomain/zero/1.0/ -->
<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8"/>
    <title>Debugger test page for Maps and Sets</title>
  </head>

  <body>
    <script>
      function startTest() {
        let obj0 = { a: 0 };
        let obj1 = { a: 1 };

        let map = new Map();
        map.set(obj0, 0);
        map.set(obj1, 1);
        map.extraProp = true;

        let weakMap = new WeakMap();
        weakMap.set(obj0, 0);
        weakMap.set(obj1, 1);
        weakMap.extraProp = true;

        let set = new Set();
        set.add(obj0);
        set.add(obj1);
        set.extraProp = true;

        let weakSet = new WeakSet();
        weakSet.add(obj0);
        weakSet.add(obj1);
        weakSet.extraProp = true;

        debugger;
      };
    </script>
  </body>

</html>