hannesw@1126: /* hannesw@1126: * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. hannesw@1126: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1126: * hannesw@1126: * This code is free software; you can redistribute it and/or modify it hannesw@1126: * under the terms of the GNU General Public License version 2 only, as hannesw@1126: * published by the Free Software Foundation. hannesw@1126: * hannesw@1126: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1126: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1126: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1126: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1126: * accompanied this code). hannesw@1126: * hannesw@1126: * You should have received a copy of the GNU General Public License version hannesw@1126: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1126: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1126: * hannesw@1126: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1126: * or visit www.oracle.com if you need additional information or have any hannesw@1126: * questions. hannesw@1126: */ hannesw@1126: hannesw@1126: /** hannesw@1126: * JDK-8066669: dust.js performance regression caused by primitive field conversion hannesw@1126: * hannesw@1126: * @test hannesw@1126: * @run hannesw@1126: */ hannesw@1126: hannesw@1126: // Make sure index access on Java objects is working as expected. hannesw@1126: var map = new java.util.HashMap(); hannesw@1126: hannesw@1126: map["foo"] = "bar"; hannesw@1126: map[1] = 2; hannesw@1126: map[false] = true; hannesw@1126: map[null] = 0; hannesw@1126: hannesw@1126: print(map); hannesw@1126: hannesw@1126: var keys = map.keySet().iterator(); hannesw@1126: hannesw@1126: while(keys.hasNext()) { hannesw@1126: var key = keys.next(); hannesw@1126: print(typeof key, key); hannesw@1126: } hannesw@1126: hannesw@1126: print(typeof map["foo"], map["foo"]); hannesw@1126: print(typeof map[1], map[1]); hannesw@1126: print(typeof map[false], map[false]); hannesw@1126: print(typeof map[null], map[null]); hannesw@1126: hannesw@1126: print(map.foo); hannesw@1126: print(map.false); hannesw@1126: print(map.null); hannesw@1126: hannesw@1126: map.foo = "baz"; hannesw@1126: print(map);