Fix Win32 JavaScriptCore bustage.
authorhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2006 22:49:32 +0000 (22:49 +0000)
committerhyatt <hyatt@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 13 Feb 2006 22:49:32 +0000 (22:49 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@12784 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj
JavaScriptCore/kjs/JSImmediate.h
JavaScriptCore/kjs/testkjs.cpp
JavaScriptCore/kjs/value.h

index 1c3ef7077756e7918564628af2a7f4ee7981c1ef..f3c6e7d764c8aa083aef4963096a40f3cf06e7fe 100644 (file)
@@ -1,3 +1,27 @@
+2006-02-13   Dave Hyatt <hyatt@apple.com>
+
+        Fix Win32 bustage in JavaScriptCore.
+
+        Reviewed by darin
+
+        * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.vcproj:
+        Add JSImmediate to the Win32 project.
+
+       * kjs/JSImmediate.h:
+        (KJS::JSImmediate::fromDouble):
+        (KJS::JSImmediate::toDouble):
+        (KJS::JSImmediate::NanAsBits):
+        (KJS::JSImmediate::oneAsBits):
+        Win32 needs explicit returns after abort() for non-void functions.
+
+        * kjs/testkjs.cpp:
+        (run):
+        Win32 catches a bug in testkjs!  The "return 2" should actually
+        have been a return false.
+
+        * kjs/value.h:
+        The extern decls of NaN and Inf need to be const.
+
 === JavaScriptCore-521.7 ===
 
 2006-02-13  Timothy Hatcher  <timothy@apple.com>
index 8dff2ccea60f7ee1f81f7992eaa31213cea15f8a..c13c8551673a55e7ef0e647dcfd337a8dae739b1 100644 (file)
                                RelativePath="..\..\kjs\interpreter.h"
                                >
                        </File>
+                       <File
+                               RelativePath="..\..\kjs\JSImmediate.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\kjs\JSImmediate.h"
+                               >
+                       </File>
                        <File
                                RelativePath="..\..\kjs\JSLock.cpp"
                                >
index 6f066f289c790baac3d2d78f6cf7d6770be2ac36..44150fa241f9123d965e317c368d45048c6c972e 100644 (file)
@@ -107,8 +107,9 @@ public:
 
             return tag(doubleUnion.asBits, NumberType);
         } else {
-            // could just return 0 here, but nicer to be explicit about not supporting the platform well
+            // could just return 0 without aborting, but nicer to be explicit about not supporting the platform well
             abort();
+            return 0;
         }
     }
     
@@ -124,8 +125,10 @@ public:
             DoubleUnion doubleUnion;
             doubleUnion.asBits = unTag(v);
             return doubleUnion.asDouble;
-        } else
+        } else {
             abort();
+            return 0;
+        }
     }
 
     static bool toBoolean(const JSValue *v)
@@ -202,8 +205,10 @@ private:
             return NaN32AsBits;
         else if (JSImmediate::is64bit())
             return NaN64AsBits;
-        else
+        else {
             abort();
+            return 0;
+        }
     }
 
     static uintptr_t zeroAsBits()
@@ -220,8 +225,10 @@ private:
             return One32AsBits;
         else if (JSImmediate::is64bit())
             return One64AsBits;
-        else
+        else {
             abort();
+            return 0;
+        }
     }
 };
 
index ea07cbdcd93cc536a46917f82cc8518dedad79bd..4b2f6b7b0c1f1f319a5315feb69894ca4be5451b 100644 (file)
@@ -167,7 +167,7 @@ bool run(const char* fileName, Interpreter *interp)
   FILE *f = fopen(fileName, "r");
   if (!f) {
     fprintf(stderr, "Error opening %s.\n", fileName);
-    return 2;
+    return false;
   }
   
   while (!feof(f) && !ferror(f)) {
index 3f5a6068b9b5457653f36c934a0c9dd9546b3fc8..452dcaf6c24f013ba430b69156b5fcdaabfcf0b1 100644 (file)
@@ -170,8 +170,8 @@ JSValue *jsNaN();
 JSCell *jsString(const UString &); // returns empty string if passed null string
 JSCell *jsString(const char * = ""); // returns empty string if passed 0
 
-extern double NaN;
-extern double Inf;
+extern const double NaN;
+extern const double Inf;
 
 
 inline JSValue *jsUndefined()