hannesw@1014: /* hannesw@1014: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. hannesw@1014: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1014: * hannesw@1014: * This code is free software; you can redistribute it and/or modify it hannesw@1014: * under the terms of the GNU General Public License version 2 only, as hannesw@1014: * published by the Free Software Foundation. hannesw@1014: * hannesw@1014: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1014: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1014: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1014: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1014: * accompanied this code). hannesw@1014: * hannesw@1014: * You should have received a copy of the GNU General Public License version hannesw@1014: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1014: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1014: * hannesw@1014: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1014: * or visit www.oracle.com if you need additional information or have any hannesw@1014: * questions. hannesw@1014: */ hannesw@1014: hannesw@1014: /** hannesw@1014: * JDK-8056978: ClassCastException: cannot cast jdk.nashorn.internal.scripts.JO* hannesw@1014: * hannesw@1014: * @test hannesw@1014: * @run hannesw@1014: */ hannesw@1014: hannesw@1014: var obj1 = { hannesw@1014: 'name': 'test name', hannesw@1014: '1': '1', hannesw@1014: '2': '2', hannesw@1014: '3': '3', hannesw@1014: '4': '4', hannesw@1014: '5': '5' hannesw@1014: }; hannesw@1014: hannesw@1014: var obj2 = { hannesw@1014: 'name': 'hello' hannesw@1014: }; hannesw@1014: hannesw@1014: print(obj2['name']); hannesw@1014: print(obj2.name); hannesw@1014: