NASHORN-331.js revision 6:5a1b0714df0e
155992Swpaul/* 255992Swpaul * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved. 355992Swpaul * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 455992Swpaul * 555992Swpaul * This code is free software; you can redistribute it and/or modify it 655992Swpaul * under the terms of the GNU General Public License version 2 only, as 755992Swpaul * published by the Free Software Foundation. 855992Swpaul * 955992Swpaul * This code is distributed in the hope that it will be useful, but WITHOUT 1055992Swpaul * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1155992Swpaul * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1255992Swpaul * version 2 for more details (a copy is included in the LICENSE file that 1355992Swpaul * accompanied this code). 1455992Swpaul * 1555992Swpaul * You should have received a copy of the GNU General Public License version 1655992Swpaul * 2 along with this work; if not, write to the Free Software Foundation, 1755992Swpaul * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1855992Swpaul * 1955992Swpaul * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2055992Swpaul * or visit www.oracle.com if you need additional information or have any 2155992Swpaul * questions. 2255992Swpaul */ 2355992Swpaul 2455992Swpaul/** 2555992Swpaul * NASHORN-331 : Nan compares 2655992Swpaul * 2755992Swpaul * @test 2855992Swpaul * @run 2955992Swpaul */ 3055992Swpaul 3155992Swpaulprint(undefined == null); 3255992Swpaulprint(undefined != null); 3355992Swpaulprint(undefined === null); 3455992Swpaulprint(undefined !== null); 3555992Swpaulprint(null == undefined); 3655992Swpaulprint(null != undefined); 3755992Swpaulprint(null === undefined); 3855992Swpaulprint(null !== undefined); 3955992Swpaul 4055992Swpaulvar n = Math.NaN; 4155992Swpaulvar x = 17; 4255992Swpaulprint(x < n); 4355992Swpaulprint(x > n); 4455992Swpaulprint(x >= n); 4555992Swpaulprint(x <= n); 4655992Swpaulprint(x == n); 4755992Swpaulprint(x != n); 4855992Swpaulprint(x == n); 4955992Swpaulprint(x !== n); 5055992Swpaul 5155992Swpaulvar u = undefined; 5255992Swpaulvar y = 18; 5355992Swpaulprint(x < u); 5455992Swpaulprint(x > u); 5555992Swpaulprint(x >= u); 5655992Swpaulprint(x <= u); 5755992Swpaulprint(x == u); 5874914Sjhbprint(x != u); 5967365Sjhbprint(x == u); 6055992Swpaulprint(x !== u); 6155992Swpaul