Mon, 21 Dec 2015 13:45:45 -0800
Added tag jdk8u75-b01 for changeset 69fa156c1ebe
hannesw@1105 | 1 | /* |
hannesw@1105 | 2 | * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. |
hannesw@1105 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
hannesw@1105 | 4 | * |
hannesw@1105 | 5 | * This code is free software; you can redistribute it and/or modify it |
hannesw@1105 | 6 | * under the terms of the GNU General Public License version 2 only, as |
hannesw@1105 | 7 | * published by the Free Software Foundation. |
hannesw@1105 | 8 | * |
hannesw@1105 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
hannesw@1105 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
hannesw@1105 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
hannesw@1105 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
hannesw@1105 | 13 | * accompanied this code). |
hannesw@1105 | 14 | * |
hannesw@1105 | 15 | * You should have received a copy of the GNU General Public License version |
hannesw@1105 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
hannesw@1105 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
hannesw@1105 | 18 | * |
hannesw@1105 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
hannesw@1105 | 20 | * or visit www.oracle.com if you need additional information or have any |
hannesw@1105 | 21 | * questions. |
hannesw@1105 | 22 | */ |
hannesw@1105 | 23 | |
hannesw@1105 | 24 | /** |
hannesw@1105 | 25 | * JDK-8057691: Nashorn: let & const declarations are not shared between scripts |
hannesw@1105 | 26 | * |
hannesw@1105 | 27 | * @subtest |
hannesw@1105 | 28 | */ |
hannesw@1105 | 29 | |
hannesw@1105 | 30 | print(VAR); |
hannesw@1105 | 31 | print(LET); |
hannesw@1105 | 32 | print(CONST); |
hannesw@1105 | 33 | print(FUNC); |
hannesw@1105 | 34 | print(GLOBAL); |
hannesw@1105 | 35 | print(this.VAR); |
hannesw@1105 | 36 | print(this.LET); // undefined |
hannesw@1105 | 37 | print(this.CONST); // undefined |
hannesw@1105 | 38 | print(this.FUNC); |
hannesw@1105 | 39 | print(this.GLOBAL); |
hannesw@1105 | 40 | print("VAR" in this); |
hannesw@1105 | 41 | print("LET" in this); // false |
hannesw@1105 | 42 | print("CONST" in this); // false |
hannesw@1105 | 43 | print("FUNC" in this); |
hannesw@1105 | 44 | print("GLOBAL" in this); |
hannesw@1105 | 45 | |
hannesw@1105 | 46 | try { |
hannesw@1105 | 47 | LET = LET + "LET"; |
hannesw@1105 | 48 | CONST = CONST + "CONST"; |
hannesw@1105 | 49 | } catch (e) { |
hannesw@1105 | 50 | print(String(e).replace(/\\/g, "/")); |
hannesw@1105 | 51 | } |