test/script/basic/JDK-8066237.js

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

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

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

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

mercurial