let-redeclare.js revision 1035:76f31d739efb
1193323Sed/* 2193323Sed * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. 3193323Sed * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4193323Sed * 5193323Sed * This code is free software; you can redistribute it and/or modify it 6193323Sed * under the terms of the GNU General Public License version 2 only, as 7193323Sed * published by the Free Software Foundation. 8193323Sed * 9193323Sed * This code is distributed in the hope that it will be useful, but WITHOUT 10193323Sed * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11193323Sed * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12193323Sed * version 2 for more details (a copy is included in the LICENSE file that 13193323Sed * accompanied this code). 14193323Sed * 15193323Sed * You should have received a copy of the GNU General Public License version 16249423Sdim * 2 along with this work; if not, write to the Free Software Foundation, 17249423Sdim * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18249423Sdim * 19249423Sdim * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20288943Sdim * or visit www.oracle.com if you need additional information or have any 21249423Sdim * questions. 22276479Sdim */ 23249423Sdim 24193323Sed/** 25193323Sed * JDK-8051889: Implement block scoping in symbol assignment and scope computation 26193323Sed * 27218885Sdim * @test 28218885Sdim * @run 29249423Sdim * @option --language=es6 30249423Sdim */ 31249423Sdim 32249423Sdimtry { 33249423Sdim eval('"use strict";\n' + 34193323Sed 'let x = 2;\n' + 35193323Sed 'let x = 2;\n'); 36193323Sed} catch (e) { 37276479Sdim print(String(e).replace(/\\/g, "/")); 38276479Sdim} 39193323Sed