lagergren@393: /* lagergren@393: * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. lagergren@393: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. lagergren@393: * lagergren@393: * This code is free software; you can redistribute it and/or modify it lagergren@393: * under the terms of the GNU General Public License version 2 only, as lagergren@393: * published by the Free Software Foundation. lagergren@393: * lagergren@393: * This code is distributed in the hope that it will be useful, but WITHOUT lagergren@393: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or lagergren@393: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License lagergren@393: * version 2 for more details (a copy is included in the LICENSE file that lagergren@393: * accompanied this code). lagergren@393: * lagergren@393: * You should have received a copy of the GNU General Public License version lagergren@393: * 2 along with this work; if not, write to the Free Software Foundation, lagergren@393: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. lagergren@393: * lagergren@393: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA lagergren@393: * or visit www.oracle.com if you need additional information or have any lagergren@393: * questions. lagergren@393: */ lagergren@393: lagergren@393: /** lagergren@393: * Regression test for erroneous shortcut optimization for object null checks lagergren@393: * lagergren@393: * @test lagergren@393: * @run lagergren@393: */ lagergren@393: lagergren@393: function toto() { lagergren@393: var friends = 1; lagergren@393: (joe = friends) == null; lagergren@393: } lagergren@407: lagergren@407: //JDK-8019476 duplicate case of this lagergren@407: Function("with(\nnull == (this % {}))( /x/g );"); lagergren@407: lagergren@407: function f() { lagergren@407: with(null == (this % {}))(/x/g); lagergren@407: } lagergren@407: lagergren@407: Function("return (null != [,,] <= this);"); lagergren@407: lagergren@407: function f2() { lagergren@407: return (null != [,,] <= this); lagergren@407: } lagergren@407: lagergren@407: 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: lagergren@407: function f3() { lagergren@407: /*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: } lagergren@407: