hannesw@1832: /* hannesw@1832: * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. hannesw@1832: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. hannesw@1832: * hannesw@1832: * This code is free software; you can redistribute it and/or modify it hannesw@1832: * under the terms of the GNU General Public License version 2 only, as hannesw@1832: * published by the Free Software Foundation. hannesw@1832: * hannesw@1832: * This code is distributed in the hope that it will be useful, but WITHOUT hannesw@1832: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or hannesw@1832: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License hannesw@1832: * version 2 for more details (a copy is included in the LICENSE file that hannesw@1832: * accompanied this code). hannesw@1832: * hannesw@1832: * You should have received a copy of the GNU General Public License version hannesw@1832: * 2 along with this work; if not, write to the Free Software Foundation, hannesw@1832: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. hannesw@1832: * hannesw@1832: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA hannesw@1832: * or visit www.oracle.com if you need additional information or have any hannesw@1832: * questions. hannesw@1832: */ hannesw@1832: hannesw@1832: /** hannesw@1832: * JDK-8156714: Parsing issue with automatic semicolon insertion hannesw@1832: * hannesw@1832: * @test hannesw@1832: * @run hannesw@1832: */ hannesw@1832: hannesw@1832: a = function() { hannesw@1832: } hannesw@1832: hannesw@1832: /* */ function b() { hannesw@1832: } hannesw@1832: hannesw@1832: c = function() { hannesw@1832: } /* hannesw@1832: hannesw@1832: */ function d() { hannesw@1832: } hannesw@1832: hannesw@1832: try { hannesw@1832: eval("x = function() {} /* */ function y() {}"); hannesw@1832: throw new Error("Error expected"); hannesw@1832: } catch (e) { hannesw@1832: if (!(e instanceof SyntaxError)) { hannesw@1832: throw new Error("Unexpected error: " + e); hannesw@1832: } hannesw@1832: }