test/script/basic/JDK-8056978.js

Wed, 03 Jun 2015 18:08:57 +0200

author
hannesw
date
Wed, 03 Jun 2015 18:08:57 +0200
changeset 1396
d5a9705a27b1
parent 1014
21cd010d3a0a
permissions
-rw-r--r--

8066237: Fuzzing bug: Parser error on optimistic recompilation
Reviewed-by: lagergren, attila

hannesw@1014 1 /*
hannesw@1014 2 * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
hannesw@1014 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
hannesw@1014 4 *
hannesw@1014 5 * This code is free software; you can redistribute it and/or modify it
hannesw@1014 6 * under the terms of the GNU General Public License version 2 only, as
hannesw@1014 7 * published by the Free Software Foundation.
hannesw@1014 8 *
hannesw@1014 9 * This code is distributed in the hope that it will be useful, but WITHOUT
hannesw@1014 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
hannesw@1014 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
hannesw@1014 12 * version 2 for more details (a copy is included in the LICENSE file that
hannesw@1014 13 * accompanied this code).
hannesw@1014 14 *
hannesw@1014 15 * You should have received a copy of the GNU General Public License version
hannesw@1014 16 * 2 along with this work; if not, write to the Free Software Foundation,
hannesw@1014 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
hannesw@1014 18 *
hannesw@1014 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
hannesw@1014 20 * or visit www.oracle.com if you need additional information or have any
hannesw@1014 21 * questions.
hannesw@1014 22 */
hannesw@1014 23
hannesw@1014 24 /**
hannesw@1014 25 * JDK-8056978: ClassCastException: cannot cast jdk.nashorn.internal.scripts.JO*
hannesw@1014 26 *
hannesw@1014 27 * @test
hannesw@1014 28 * @run
hannesw@1014 29 */
hannesw@1014 30
hannesw@1014 31 var obj1 = {
hannesw@1014 32 'name': 'test name',
hannesw@1014 33 '1': '1',
hannesw@1014 34 '2': '2',
hannesw@1014 35 '3': '3',
hannesw@1014 36 '4': '4',
hannesw@1014 37 '5': '5'
hannesw@1014 38 };
hannesw@1014 39
hannesw@1014 40 var obj2 = {
hannesw@1014 41 'name': 'hello'
hannesw@1014 42 };
hannesw@1014 43
hannesw@1014 44 print(obj2['name']);
hannesw@1014 45 print(obj2.name);
hannesw@1014 46

mercurial