sundar@394: /* sundar@394: * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. sundar@394: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. sundar@394: * sundar@394: * This code is free software; you can redistribute it and/or modify it sundar@394: * under the terms of the GNU General Public License version 2 only, as sundar@394: * published by the Free Software Foundation. sundar@394: * sundar@394: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@394: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@394: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@394: * version 2 for more details (a copy is included in the LICENSE file that sundar@394: * accompanied this code). sundar@394: * sundar@394: * You should have received a copy of the GNU General Public License version sundar@394: * 2 along with this work; if not, write to the Free Software Foundation, sundar@394: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. sundar@394: * sundar@394: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@394: * or visit www.oracle.com if you need additional information or have any sundar@394: * questions. sundar@394: */ sundar@394: sundar@394: /** sundar@394: * JDK-8019553: NPE on illegal l-value for increment and decrement sundar@394: * sundar@394: * @test sundar@394: * @run sundar@394: */ sundar@394: sundar@394: function check(str) { sundar@394: try { sundar@394: eval(str); sundar@394: fail("SyntaxError expected for: " + str); sundar@394: } catch (e) { sundar@394: print(e.toString().replace(/\\/g, '/')); sundar@394: } sundar@394: } sundar@394: sundar@394: check("++ +3"); sundar@394: check("++ -7"); sundar@394: check("-- +2"); sundar@394: check("-- -8");