test/script/error/JDK-8098847.js

Fri, 06 Sep 2019 03:21:30 +0100

author
andrew
date
Fri, 06 Sep 2019 03:21:30 +0100
changeset 2516
ad8af81cc28b
parent 1413
fb91ff186894
permissions
-rw-r--r--

Added tag jdk8u242-b00 for changeset 8a951fd037e2

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

mercurial