yan@995: /* yan@995: * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. yan@995: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. yan@995: * yan@995: * This code is free software; you can redistribute it and/or modify it yan@995: * under the terms of the GNU General Public License version 2 only, as yan@995: * published by the Free Software Foundation. yan@995: * yan@995: * This code is distributed in the hope that it will be useful, but WITHOUT yan@995: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or yan@995: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License yan@995: * version 2 for more details (a copy is included in the LICENSE file that yan@995: * accompanied this code). yan@995: * yan@995: * You should have received a copy of the GNU General Public License version yan@995: * 2 along with this work; if not, write to the Free Software Foundation, yan@995: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. yan@995: * yan@995: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA yan@995: * or visit www.oracle.com if you need additional information or have any yan@995: * questions. yan@995: */ yan@995: yan@995: /** yan@995: * JDK-8057678: Tests for let&const keywords in Nashorn yan@995: * yan@995: * @test yan@995: * @run yan@995: * @option --language=es6 yan@995: * @option -scripting yan@995: */ yan@995: yan@995: yan@995: function tryIt (code) { yan@995: try { yan@995: eval(code) yan@995: } catch (e) { slugovoy@1112: print(String(e).replace(/\\/g, "/")) yan@995: } yan@995: } yan@995: yan@995: tryIt(<