const-redeclare.js revision 1035:76f31d739efb
1294109Sbapt/* 2294109Sbapt * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 3294109Sbapt * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4294109Sbapt * 5294109Sbapt * This code is free software; you can redistribute it and/or modify it 6294109Sbapt * under the terms of the GNU General Public License version 2 only, as 7294109Sbapt * published by the Free Software Foundation. 8294109Sbapt * 9294109Sbapt * This code is distributed in the hope that it will be useful, but WITHOUT 10294109Sbapt * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11294109Sbapt * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12294109Sbapt * version 2 for more details (a copy is included in the LICENSE file that 13294109Sbapt * accompanied this code). 14294109Sbapt * 15294109Sbapt * You should have received a copy of the GNU General Public License version 16294109Sbapt * 2 along with this work; if not, write to the Free Software Foundation, 17294109Sbapt * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18294109Sbapt * 19294109Sbapt * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20294109Sbapt * or visit www.oracle.com if you need additional information or have any 21294109Sbapt * questions. 22294109Sbapt */ 23294109Sbapt 24/** 25 * JDK-8051889: Implement block scoping in symbol assignment and scope computation 26 * 27 * @test 28 * @run 29 * @option --language=es6 30 */ 31 32try { 33 eval('"use strict";\n' + 34 'const x = 2;\n' + 35 'const x = 2;\n'); 36} catch (e) { 37 print(String(e).replace(/\\/g, "/")); 38} 39