NASHORN-318.js revision 2:da1e581c933b
1181905Sed/* 2181905Sed * Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved. 3181905Sed * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4181905Sed * 5181905Sed * This code is free software; you can redistribute it and/or modify it 6181905Sed * under the terms of the GNU General Public License version 2 only, as 7181905Sed * published by the Free Software Foundation. 8181905Sed * 9181905Sed * This code is distributed in the hope that it will be useful, but WITHOUT 10181905Sed * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11181905Sed * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12181905Sed * version 2 for more details (a copy is included in the LICENSE file that 13181905Sed * accompanied this code). 14181905Sed * 15181905Sed * You should have received a copy of the GNU General Public License version 16181905Sed * 2 along with this work; if not, write to the Free Software Foundation, 17181905Sed * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18181905Sed * 19181905Sed * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20181905Sed * or visit www.oracle.com if you need additional information or have any 21181905Sed * questions. 22181905Sed */ 23181905Sed 24181905Sed/** 25181905Sed * NASHORN-318 : (null == {}) evaluates to true and (null != {}) evaluates to false 26181905Sed * 27181905Sed * @test 28181905Sed * @run 29181905Sed */ 30181905Sed 31181905Sedprint("null == {} ? " + (null == {})); 32181905Sedprint("null != {} ? " + (null != {})); 33181905Sed 34181905Sedvar x = null; 35181905Sedprint("null == x ? " + (null == x)); 36181905Sedprint("x == null ? " + (x == null)); 37181905Sed