sundar@982: /* sundar@982: * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. sundar@982: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. sundar@982: * sundar@982: * This code is free software; you can redistribute it and/or modify it sundar@982: * under the terms of the GNU General Public License version 2 only, as sundar@982: * published by the Free Software Foundation. sundar@982: * sundar@982: * This code is distributed in the hope that it will be useful, but WITHOUT sundar@982: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or sundar@982: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License sundar@982: * version 2 for more details (a copy is included in the LICENSE file that sundar@982: * accompanied this code). sundar@982: * sundar@982: * You should have received a copy of the GNU General Public License version sundar@982: * 2 along with this work; if not, write to the Free Software Foundation, sundar@982: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. sundar@982: * sundar@982: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA sundar@982: * or visit www.oracle.com if you need additional information or have any sundar@982: * questions. sundar@982: */ sundar@982: sundar@982: /** sundar@982: * JDK-8056123: Anonymous function statements leak internal function names into global scope sundar@982: * sundar@982: * @test sundar@982: * @run sundar@982: */ sundar@982: sundar@982: // do *not* introduce newlines before this line! sundar@982: function () { // line 32 sundar@982: print("hello function!"); sundar@982: } sundar@982: sundar@982: if (typeof this["L:32"] != 'undefined') { sundar@982: fail("anonymous function statement leaks name in global"); sundar@982: } sundar@982: sundar@982: var keys = Object.keys(this); sundar@982: for (var i in keys) { sundar@982: if (keys[i].contains("L:")) { sundar@982: fail("found " + keys[i] + " in global scope"); sundar@982: } sundar@982: }