JavaScript Test - add testcases from bug 375793, by Jesse Ruderman
authorbclary@bclary.com
Fri, 30 Mar 2007 07:52:37 -0700
changeset 228 3021ba3daa9b34ee30d18231c897446d1b00c643
parent 227 002455a7478c8ab0d0a6d35fbc8a773f9d42ac49
child 229 9689bb284113c0372d683cdcf76c8701b010c197
push idunknown
push userunknown
push dateunknown
bugs375793
milestone1.9a4pre
JavaScript Test - add testcases from bug 375793, by Jesse Ruderman
js/tests/ecma/TypeConversion/9.2.js
--- a/js/tests/ecma/TypeConversion/9.2.js
+++ b/js/tests/ecma/TypeConversion/9.2.js
@@ -15,17 +15,18 @@
  * The Original Code is Mozilla Communicator client code, released
  * March 31, 1998.
  *
  * The Initial Developer of the Original Code is
  * Netscape Communications Corporation.
  * Portions created by the Initial Developer are Copyright (C) 1998
  * the Initial Developer. All Rights Reserved.
  *
- * Contributor(s):
+ * Contributor(s): christine@netscape.com
+ *                 Jesse Ruderman
  *
  * Alternatively, the contents of this file may be used under the terms of
  * either the GNU General Public License Version 2 or later (the "GPL"), or
  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  * in which case the provisions of the GPL or the LGPL are applicable instead
  * of those above. If you wish to allow use of your version of this file only
  * under the terms of either the GPL or the LGPL, and not to allow others to
  * use your version of this file under the terms of the MPL, indicate your
@@ -104,10 +105,32 @@ new TestCase( SECTION,   "Boolean(new Nu
 new TestCase( SECTION,   "Boolean(new Number(-Infinity))",true,   Boolean(new Number(Number.NEGATIVE_INFINITY)) );
 
 new TestCase( SECTION,    "Boolean(new Object())",       true,       Boolean(new Object()) );
 new TestCase( SECTION,    "Boolean(new Function())",     true,       Boolean(new Function()) );
 new TestCase( SECTION,    "Boolean(new Date())",         true,       Boolean(new Date()) );
 new TestCase( SECTION,    "Boolean(new Date(0))",         true,       Boolean(new Date(0)) );
 new TestCase( SECTION,    "Boolean(Math)",         true,       Boolean(Math) );
 
+// bug 375793
+new TestCase( SECTION,
+              "NaN ? true : false",
+              false,
+              (NaN ? true : false) );
+new TestCase( SECTION,
+              "1000 % 0 ? true : false",
+              false,
+              (1000 % 0 ? true : false) );
+new TestCase( SECTION,
+              "(function(a,b){ return a % b ? true : false })(1000, 0)",
+              false,
+              ((function(a,b){ return a % b ? true : false })(1000, 0)) );
+
+new TestCase( SECTION,
+              "(function(x) { return !(x) })(0/0)",
+              true,
+              ((function(x) { return !(x) })(0/0)) );
+new TestCase( SECTION,
+              "!(0/0)",
+              true,
+              (!(0/0)) );
 test();