JDK-8144711.js revision 1675:9ecc29462c48
190075Sobrien/* 290075Sobrien * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. 390075Sobrien * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 490075Sobrien * 590075Sobrien * This code is free software; you can redistribute it and/or modify it 690075Sobrien * under the terms of the GNU General Public License version 2 only, as 790075Sobrien * published by the Free Software Foundation. 890075Sobrien * 990075Sobrien * This code is distributed in the hope that it will be useful, but WITHOUT 10169689Skan * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1190075Sobrien * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1290075Sobrien * version 2 for more details (a copy is included in the LICENSE file that 1390075Sobrien * accompanied this code). 1490075Sobrien * 1590075Sobrien * You should have received a copy of the GNU General Public License version 1690075Sobrien * 2 along with this work; if not, write to the Free Software Foundation, 1790075Sobrien * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1890075Sobrien * 1990075Sobrien * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2090075Sobrien * or visit www.oracle.com if you need additional information or have any 21169689Skan * questions. 22169689Skan */ 2390075Sobrien 2490075Sobrien/** 25169689Skan * JDK-8144711: (x) => x + 1 causes Assertion failure instead of SyntaxError 2690075Sobrien * 2790075Sobrien * @test 2890075Sobrien * @run 2990075Sobrien */ 3090075Sobrien 3190075Sobrientry { 3290075Sobrien eval("(x) => x + 1"); 3390075Sobrien throw new Error ("should not reach here"); 3490075Sobrien} catch (e) { 3590075Sobrien Assert.assertTrue(e instanceof SyntaxError); 3690075Sobrien} 3790075Sobrien