+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>
RelativePath="..\..\kjs\interpreter.h"
>
</File>
+ <File
+ RelativePath="..\..\kjs\JSImmediate.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\..\kjs\JSImmediate.h"
+ >
+ </File>
<File
RelativePath="..\..\kjs\JSLock.cpp"
>
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;
}
}
DoubleUnion doubleUnion;
doubleUnion.asBits = unTag(v);
return doubleUnion.asDouble;
- } else
+ } else {
abort();
+ return 0;
+ }
}
static bool toBoolean(const JSValue *v)
return NaN32AsBits;
else if (JSImmediate::is64bit())
return NaN64AsBits;
- else
+ else {
abort();
+ return 0;
+ }
}
static uintptr_t zeroAsBits()
return One32AsBits;
else if (JSImmediate::is64bit())
return One64AsBits;
- else
+ else {
abort();
+ return 0;
+ }
}
};
FILE *f = fopen(fileName, "r");
if (!f) {
fprintf(stderr, "Error opening %s.\n", fileName);
- return 2;
+ return false;
}
while (!feof(f) && !ferror(f)) {
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()