test/script/basic/JDK-8019553.js

Thu, 10 Oct 2013 11:48:56 +0200

author
sundar
date
Thu, 10 Oct 2013 11:48:56 +0200
changeset 606
7cc5ff16380f
parent 394
74049fe3ba46
child 952
6d5471a497fb
child 962
ac62e33a99b0
permissions
-rw-r--r--

8026167: Class cache/reuse of 'eval' scripts results in ClassCastException in some cases.
Reviewed-by: lagergren, jlaskey

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.
sundar@394 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.
sundar@394 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).
sundar@394 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.
sundar@394 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