19258b6bc66e09368ada54001f619d53b4fc976d5ager@chromium.org// Copyright 2008 the V8 project authors. All rights reserved. 29a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// Redistribution and use in source and binary forms, with or without 39a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// modification, are permitted provided that the following conditions are 49a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// met: 59a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// 69a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// * Redistributions of source code must retain the above copyright 79a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// notice, this list of conditions and the following disclaimer. 89a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// * Redistributions in binary form must reproduce the above 99a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// copyright notice, this list of conditions and the following 109a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// disclaimer in the documentation and/or other materials provided 119a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// with the distribution. 129a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// * Neither the name of Google Inc. nor the names of its 139a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// contributors may be used to endorse or promote products derived 149a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// from this software without specific prior written permission. 159a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// 169a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 179a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 189a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 199a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 209a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 219a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 229a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 239a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 249a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 259a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 269a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 279a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com 289a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.comvar a = [NaN, -1, 0, 1, 1.2, -7.9, true, false, 'foo', '0', 'NaN' ]; 299a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.comfor (var i in a) { 309a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com var x = a[i]; 312abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(NaN == x, "NaN == " + x); 322abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(NaN === x, "NaN === " + x); 332abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(NaN < x, "NaN < " + x); 342abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(NaN > x, "NaN > " + x); 352abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(NaN <= x, "NaN <= " + x); 362abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(NaN >= x, "NaN >= " + x); 379a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com 382abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(x == NaN, "" + x + " == NaN"); 392abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(x === NaN, "" + x + " === NaN"); 402abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(x < NaN, "" + x + " < NaN"); 412abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(x > NaN, "" + x + " > NaN"); 422abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(x <= NaN, "" + x + " <= NaN"); 432abc450936e88b5c98a5e9d43ee6230ccc748272kasperl@chromium.org assertFalse(x >= NaN, "" + x + " >= NaN"); 449a4089a092cad9ff23b6416b92cd5d818dc101d1mads.s.ager@gmail.com} 450c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org 460c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.orgvar b = ["NaN", "-1", "0", "1", "1.2", "-7.9", "true", "false", "'foo'", "'0'", 470c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "'NaN'" ]; 480c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.orgfor (var i in b) { 490c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org var x = b[i]; 500c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org var program = 510c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(NaN == " + x + ", 'NaN == ' + " + x + ");\n" + 520c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(NaN === " + x + ", 'NaN === ' + " + x + ");\n" + 530c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(NaN < " + x + ", 'NaN < ' + " + x + ");\n" + 540c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(NaN > " + x + ", 'NaN > ' + " + x + ");\n" + 550c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(NaN <= " + x + ", 'NaN <= ' + " + x + ");\n" + 560c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(NaN >= " + x + ", 'NaN >= ' + " + x + ");\n" + 570c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org 580c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(" + x + " == NaN, '' + " + x + " + ' == NaN');\n" + 590c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(" + x + " === NaN, '' + " + x + " + ' === NaN');\n" + 600c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(" + x + " < NaN, '' + " + x + " + ' < NaN');\n" + 610c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(" + x + " > NaN, '' + " + x + " + ' > NaN');\n" + 620c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(" + x + " <= NaN, '' + " + x + " + ' <= NaN');\n" + 630c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org "assertFalse(" + x + " >= NaN, '' + " + x + " + ' >= NaN');\n"; 640c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org eval(program); 650c20e676f8a0209982ff89e5a9c707771748a585fschneider@chromium.org} 66