attila@1019: /* attila@1019: * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. attila@1019: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. attila@1019: * attila@1019: * This code is free software; you can redistribute it and/or modify it attila@1019: * under the terms of the GNU General Public License version 2 only, as attila@1019: * published by the Free Software Foundation. attila@1019: * attila@1019: * This code is distributed in the hope that it will be useful, but WITHOUT attila@1019: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or attila@1019: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License attila@1019: * version 2 for more details (a copy is included in the LICENSE file that attila@1019: * accompanied this code). attila@1019: * attila@1019: * You should have received a copy of the GNU General Public License version attila@1019: * 2 along with this work; if not, write to the Free Software Foundation, attila@1019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. attila@1019: * attila@1019: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA attila@1019: * or visit www.oracle.com if you need additional information or have any attila@1019: * questions. attila@1019: */ attila@1019: attila@1019: /** attila@1019: * JDK-8058561: NPE in LocalVariableTypesCalculator attila@1019: * attila@1019: * @test attila@1019: * @run attila@1019: * @option --lazy-compilation=false attila@1019: */ attila@1019: attila@1019: // Just attempting to compile this caused the NPE attila@1019: function func(x, y) { attila@1019: while(true) { attila@1019: switch (y[0]) { attila@1019: case "bar": attila@1019: x = 'xxx'; attila@1019: break; attila@1019: } attila@1019: } attila@1019: return x; attila@1019: }