Tue, 01 Sep 2015 18:28:11 +0530
8068901: Surprising behavior with more than one functional interface on a class
8068903: Can't invoke vararg @FunctionalInterface methods
Reviewed-by: attila, hannesw
lagergren@393 | 1 | /* |
lagergren@393 | 2 | * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. |
lagergren@393 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
attila@962 | 4 | * |
lagergren@393 | 5 | * This code is free software; you can redistribute it and/or modify it |
lagergren@393 | 6 | * under the terms of the GNU General Public License version 2 only, as |
lagergren@393 | 7 | * published by the Free Software Foundation. |
attila@962 | 8 | * |
lagergren@393 | 9 | * This code is distributed in the hope that it will be useful, but WITHOUT |
lagergren@393 | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
lagergren@393 | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
lagergren@393 | 12 | * version 2 for more details (a copy is included in the LICENSE file that |
lagergren@393 | 13 | * accompanied this code). |
attila@962 | 14 | * |
lagergren@393 | 15 | * You should have received a copy of the GNU General Public License version |
lagergren@393 | 16 | * 2 along with this work; if not, write to the Free Software Foundation, |
lagergren@393 | 17 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
attila@962 | 18 | * |
lagergren@393 | 19 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
lagergren@393 | 20 | * or visit www.oracle.com if you need additional information or have any |
lagergren@393 | 21 | * questions. |
lagergren@393 | 22 | */ |
lagergren@393 | 23 | |
lagergren@393 | 24 | /** |
lagergren@393 | 25 | * Regression test for erroneous shortcut optimization for object null checks |
lagergren@393 | 26 | * |
lagergren@393 | 27 | * @test |
lagergren@393 | 28 | * @run |
lagergren@393 | 29 | */ |
lagergren@393 | 30 | |
lagergren@393 | 31 | function toto() { |
lagergren@393 | 32 | var friends = 1; |
lagergren@393 | 33 | (joe = friends) == null; |
attila@962 | 34 | } |
lagergren@407 | 35 | |
lagergren@407 | 36 | //JDK-8019476 duplicate case of this |
attila@962 | 37 | Function("with(\nnull == (this % {}))( /x/g );"); |
lagergren@407 | 38 | |
lagergren@407 | 39 | function f() { |
lagergren@407 | 40 | with(null == (this % {}))(/x/g); |
lagergren@407 | 41 | } |
lagergren@407 | 42 | |
attila@962 | 43 | Function("return (null != [,,] <= this);"); |
lagergren@407 | 44 | |
lagergren@407 | 45 | function f2() { |
lagergren@407 | 46 | return (null != [,,] <= this); |
lagergren@407 | 47 | } |
lagergren@407 | 48 | |
attila@962 | 49 | Function("/*infloop*/L:for(var x; ([+(function (window)[,,])(function(q) { return q; }, -0)].some(new Function)); [11,12,13,14].some) {/*infloop*/do {;return this; } while(x); }"); |
lagergren@407 | 50 | |
lagergren@407 | 51 | function f3() { |
lagergren@407 | 52 | /*infloop*/L:for(var x; ([+(function (window)[,,])(function(q) { return q; }, -0)].some(new Function)); [11,12,13,14].some) {/*infloop*/do {;return this; } while(x); } |
lagergren@407 | 53 | } |
lagergren@407 | 54 |