test/script/basic/JDK-8016667.js

Wed, 18 Jun 2014 12:35:42 -0700

author
katleman
date
Wed, 18 Jun 2014 12:35:42 -0700
changeset 863
6e9c4e34bc61
parent 407
961cffae0828
child 952
6d5471a497fb
child 962
ac62e33a99b0
permissions
-rw-r--r--

Added tag jdk8u20-b19 for changeset b047df215de4

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.
lagergren@393 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.
lagergren@393 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).
lagergren@393 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.
lagergren@393 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;
lagergren@393 34 }
lagergren@407 35
lagergren@407 36 //JDK-8019476 duplicate case of this
lagergren@407 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
lagergren@407 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
lagergren@407 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

mercurial