JDK-8066224.js revision 1136:42f7a7a8f34d
1139749Simp/* 2128967Srik * Copyright (c) 2014 Oracle and/or its affiliates. All rights reserved. 3128967Srik * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4128967Srik * 5128967Srik * This code is free software; you can redistribute it and/or modify it 6128967Srik * under the terms of the GNU General Public License version 2 only, as 7128967Srik * published by the Free Software Foundation. 8128967Srik * 9128967Srik * This code is distributed in the hope that it will be useful, but WITHOUT 10128967Srik * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11128967Srik * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12128967Srik * version 2 for more details (a copy is included in the LICENSE file that 13128967Srik * accompanied this code). 14128967Srik * 15128967Srik * You should have received a copy of the GNU General Public License version 16128967Srik * 2 along with this work; if not, write to the Free Software Foundation, 17128967Srik * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18138698Srik * 19128967Srik * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20128967Srik * or visit www.oracle.com if you need additional information or have any 21128967Srik * questions. 22128967Srik */ 23128967Srik 24128967Srik/** 25128967Srik * JDK-8066224: fixes for folding a constant-test ternary operator 26128967Srik * 27128967Srik * @test 28128967Srik * @run 29128967Srik */ 30128967Srik 31128967Srikprint((function(){ 32128967Srik if(false ? 0 : '') { 33128967Srik throw false; 34128967Srik } else if (x = this) { 35128967Srik var x = x; 36128967Srik } 37128967Srik return x === this; 38128967Srik})()) 39128967Srik