hannesw@1546: /* hannesw@1546: * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. hannesw@1546: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1546: * hannesw@1546: * This code is free software; you can redistribute it and/or modify it hannesw@1546: * under the terms of the GNU General Public License version 2 only, as hannesw@1546: * published by the Free Software Foundation. hannesw@1546: * hannesw@1546: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1546: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1546: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1546: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1546: * accompanied this code). hannesw@1546: * hannesw@1546: * You should have received a copy of the GNU General Public License version hannesw@1546: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1546: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1546: * hannesw@1546: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1546: * or visit www.oracle.com if you need additional information or have any hannesw@1546: * questions. hannesw@1546: */ hannesw@1546: hannesw@1546: /** hannesw@1546: * JDK-8087312: PropertyMapWrapper.equals should compare className hannesw@1546: * hannesw@1546: * @test hannesw@1546: * @run hannesw@1546: * @fork hannesw@1546: * @option -Dnashorn.debug=true hannesw@1546: */ hannesw@1546: hannesw@1546: function createObject(type) { hannesw@1546: // we want to make sure two different object literals with the same keys and types share the same property map. hannesw@1546: if (type) { hannesw@1546: return { hannesw@1546: a: "a", hannesw@1546: b: 1, hannesw@1546: c: 0.1 hannesw@1546: } hannesw@1546: } else { hannesw@1546: return { hannesw@1546: a: "x", hannesw@1546: b: 10, hannesw@1546: c: 3.4 hannesw@1546: } hannesw@1546: } hannesw@1546: } hannesw@1546: hannesw@1546: var o1 = createObject(false); hannesw@1546: var o2 = createObject(true); hannesw@1546: Assert.assertTrue(Debug.map(o1) === Debug.map(o2)); hannesw@1546: