JDK-8066224.js revision 1365:833a4df84bc7
1219019Sgabor/*
2219019Sgabor * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
3219019Sgabor * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4219019Sgabor *
5219019Sgabor * This code is free software; you can redistribute it and/or modify it
6219019Sgabor * under the terms of the GNU General Public License version 2 only, as
7219019Sgabor * published by the Free Software Foundation.
8219019Sgabor *
9219019Sgabor * This code is distributed in the hope that it will be useful, but WITHOUT
10219019Sgabor * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11219019Sgabor * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12219019Sgabor * version 2 for more details (a copy is included in the LICENSE file that
13219019Sgabor * accompanied this code).
14219019Sgabor *
15219019Sgabor * You should have received a copy of the GNU General Public License version
16219019Sgabor * 2 along with this work; if not, write to the Free Software Foundation,
17219019Sgabor * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18219019Sgabor *
19219019Sgabor * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20219019Sgabor * or visit www.oracle.com if you need additional information or have any
21219019Sgabor * questions.
22219019Sgabor */
23219019Sgabor
24219019Sgabor/**
25219019Sgabor * JDK-8066224: fixes for folding a constant-test ternary operator
26219019Sgabor *
27219019Sgabor * @test
28219019Sgabor * @run
29219019Sgabor */
30219019Sgabor
31219019Sgaborprint((function(){
32219019Sgabor    if(false ? 0 : '') {
33219019Sgabor        throw false;
34219019Sgabor    } else if (x = this) {
35219019Sgabor        var x = x;
36219019Sgabor    }
37219019Sgabor    return x === this;
38219019Sgabor})())
39219019Sgabor