test/script/basic/JDK-8134490.js

Tue, 21 Mar 2017 13:41:57 -0700

author
asaha
date
Tue, 21 Mar 2017 13:41:57 -0700
changeset 2160
1df40fe54cd6
parent 1827
1bd585e65406
permissions
-rw-r--r--

Merge

attila@1549 1 /*
sundar@1827 2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
attila@1549 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
attila@1549 4 *
attila@1549 5 * This code is free software; you can redistribute it and/or modify it
attila@1549 6 * under the terms of the GNU General Public License version 2 only, as
attila@1549 7 * published by the Free Software Foundation.
attila@1549 8 *
attila@1549 9 * This code is distributed in the hope that it will be useful, but WITHOUT
attila@1549 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
attila@1549 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
attila@1549 12 * version 2 for more details (a copy is included in the LICENSE file that
attila@1549 13 * accompanied this code).
attila@1549 14 *
attila@1549 15 * You should have received a copy of the GNU General Public License version
attila@1549 16 * 2 along with this work; if not, write to the Free Software Foundation,
attila@1549 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
attila@1549 18 *
attila@1549 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
attila@1549 20 * or visit www.oracle.com if you need additional information or have any
attila@1549 21 * questions.
attila@1549 22 */
attila@1549 23
attila@1549 24 /**
attila@1549 25 * JDK-8134490: Dead var statement evacuation incorrectly descends into nested functions
attila@1549 26 *
attila@1549 27 * @test
attila@1549 28 * @run
attila@1549 29 */
attila@1549 30
attila@1549 31 var v1;
attila@1549 32
attila@1549 33 function f1()
attila@1549 34 {
attila@1549 35 v1 = 1;
attila@1549 36 return true;
attila@1549 37 (function () { var v1; })();
attila@1549 38 }
attila@1549 39
attila@1549 40 f1();
attila@1549 41 // If it executes without throwing an exception in code generator, it's working.

mercurial