nashorn/test/script/basic/JDK-8067774.js
author sundar
Wed, 06 May 2015 20:04:42 +0530
changeset 30394 72a59e4dffea
parent 28130 433d6755c5f8
child 31925 85c87bc2f1f3
permissions -rw-r--r--
8079470: Misleading error message when explicit signature constructor is called with wrong arguments Reviewed-by: jlaskey, hannesw
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28130
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     1
/*
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     2
 * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved.
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     4
 * 
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     7
 * published by the Free Software Foundation.
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     8
 * 
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    13
 * accompanied this code).
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    14
 * 
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    18
 * 
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    21
 * questions.
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    22
 */
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    23
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    24
/**
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    25
 * JDK-8067774: Use a stack of types when calculating local variable types
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    26
 *
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    27
 * @test
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    28
 * @run
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    29
 */
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    30
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    31
print((function (p) {
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    32
    var a, b;
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    33
    
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    34
    a = p ? ((b = 1), b) : 0;
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    35
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    36
    return a;
433d6755c5f8 8067774: Use a stack of types when calculating local variable types
attila
parents:
diff changeset
    37
})(true));