test/script/basic/JDK-8019553.js

Tue, 15 Jan 2019 10:36:25 +0000

author
aefimov
date
Tue, 15 Jan 2019 10:36:25 +0000
changeset 2462
e9169a96a3d1
parent 962
ac62e33a99b0
child 1205
4112748288bb
permissions
-rw-r--r--

Added tag jdk8u202-ga for changeset 7aeae6eb6236

sundar@394 1 /*
sundar@394 2 * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
sundar@394 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@962 4 *
sundar@394 5 * This code is free software; you can redistribute it and/or modify it
sundar@394 6 * under the terms of the GNU General Public License version 2 only, as
sundar@394 7 * published by the Free Software Foundation.
attila@962 8 *
sundar@394 9 * This code is distributed in the hope that it will be useful, but WITHOUT
sundar@394 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
sundar@394 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
sundar@394 12 * version 2 for more details (a copy is included in the LICENSE file that
sundar@394 13 * accompanied this code).
attila@962 14 *
sundar@394 15 * You should have received a copy of the GNU General Public License version
sundar@394 16 * 2 along with this work; if not, write to the Free Software Foundation,
sundar@394 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@962 18 *
sundar@394 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
sundar@394 20 * or visit www.oracle.com if you need additional information or have any
sundar@394 21 * questions.
sundar@394 22 */
sundar@394 23
sundar@394 24 /**
sundar@394 25 * JDK-8019553: NPE on illegal l-value for increment and decrement
sundar@394 26 *
sundar@394 27 * @test
sundar@394 28 * @run
sundar@394 29 */
sundar@394 30
sundar@394 31 function check(str) {
sundar@394 32 try {
sundar@394 33 eval(str);
sundar@394 34 fail("SyntaxError expected for: " + str);
sundar@394 35 } catch (e) {
sundar@606 36 printError(e);
sundar@394 37 }
sundar@394 38 }
sundar@394 39
sundar@394 40 check("++ +3");
sundar@394 41 check("++ -7");
sundar@394 42 check("-- +2");
sundar@394 43 check("-- -8");

mercurial