Debian Codegraph @

rhino/testsrc/doctests/413838.doctest

raw
1 // This Source Code Form is subject to the terms of the Mozilla Public
2 // License, v. 2.0. If a copy of the MPL was not distributed with this
3 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
5 js> var map = new java.util.HashMap();
6 js> map.put("a","hi");
7 null
8 js> map.put("b","hi");
9 null
10 js> map.get("a") == map.get("b")
11 true
12 js> map.put("c",1)
13 null
14 js> map.put("c",1)
15 1.0
16 js> map.put("d",1)
17 null
18 js> map.get("c") == map.get("d")
19 true
20 js> map.get("a") == map.get("d")
21 false
22 js> map.put("e","1")
23 null
24 js> map.get("d") == map.get("e")
25 true
26 js> map.put("f", true)
27 null
28 js> map.put("g", true)
29 null
30 js> map.get("f") == map.get("g")
31 true
32 js> var obj = {}
33 js> map.put("h", obj)
34 null
35 js> map.put("i", obj)
36 null
37 js> map.get("h") == map.get("i")
38 true
39 js> map.put("j", {})
40 null
41 js> map.get("i") == map.get("j")
42 false