Followup, Windows is dumb and doesn't allow 1.0 / 0.0 (spec violation?). r=bustage
authorJeff Walden <jwalden@mit.edu>
Wed, 06 Apr 2011 11:29:47 -0700
changeset 67925 a1cd032bdf77c8939ebfe8b3f3a90925cb62bc2c
parent 67924 7b977e10c72163a2a472e64f9e75f924a2999fd7
child 67926 b7a9e67f2e545d6522664393e22d2efa329ae2fd
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Followup, Windows is dumb and doesn't allow 1.0 / 0.0 (spec violation?). r=bustage
js/src/jsapi-tests/testParseJSON.cpp
--- a/js/src/jsapi-tests/testParseJSON.cpp
+++ b/js/src/jsapi-tests/testParseJSON.cpp
@@ -1,12 +1,15 @@
 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * vim: set ts=8 sw=4 et tw=99:
  */
 
+#include <limits>
+#include <math.h>
+
 #include "tests.h"
 #include "jsstr.h"
 
 class AutoInflatedString {
     JSContext * const cx;
     jschar *chars_;
     size_t length_;
 
@@ -40,17 +43,17 @@ BEGIN_TEST(testParseJSON_success)
     CHECK(TryParse(cx, "false", JSVAL_FALSE));
     CHECK(TryParse(cx, "null", JSVAL_NULL));
     CHECK(TryParse(cx, "0", INT_TO_JSVAL(0)));
     CHECK(TryParse(cx, "1", INT_TO_JSVAL(1)));
     CHECK(TryParse(cx, "-1", INT_TO_JSVAL(-1)));
     CHECK(TryParse(cx, "1", DOUBLE_TO_JSVAL(1)));
     CHECK(TryParse(cx, "1.75", DOUBLE_TO_JSVAL(1.75)));
     CHECK(TryParse(cx, "9e9", DOUBLE_TO_JSVAL(9e9)));
-    CHECK(TryParse(cx, "9e99999", DOUBLE_TO_JSVAL(1.0 / 0.0)));
+    CHECK(TryParse(cx, "9e99999", DOUBLE_TO_JSVAL(std::numeric_limits<jsdouble>::infinity())));
 
     JSFlatString *str;
 
     const jschar emptystr[] = { '\0' };
     str = js_NewStringCopyN(cx, emptystr, 0);
     CHECK(str);
     CHECK(TryParse(cx, "\"\"", STRING_TO_JSVAL(str)));