- fixed <rdar://problem/
3804661> REGRESSION: JavaScriptCore framework now has two init routines
* bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
creating an init routine.
* kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
require a global constructor that creates an init routine.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7798
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2004-10-09 Darin Adler <darin@apple.com>
+
+ Reviewed by Kevin.
+
+ - fixed <rdar://problem/3804661> REGRESSION: JavaScriptCore framework now has two init routines
+
+ * bindings/NP_jsobject.cpp: Fixed unnecessarily-complex globals set up that was
+ creating an init routine.
+
+ * kjs/ustring.cpp: Changed around the UString::Rep::empty construction to not
+ require a global constructor that creates an init routine.
+
2004-10-09 Darin Adler <darin@apple.com>
Reviewed by Kevin.
2004-10-09 Darin Adler <darin@apple.com>
Reviewed by Kevin.
-static NPClass *javascriptClass = &_javascriptClass;
-NPClass *NPScriptObjectClass = javascriptClass;
+NPClass *NPScriptObjectClass = &_javascriptClass;
Identifier identiferFromNPIdentifier(const NPUTF8 *name)
{
Identifier identiferFromNPIdentifier(const NPUTF8 *name)
{
return len == c2.size() && (len == 0 || memcmp(c1.c_str(), c2.c_str(), len) == 0);
}
return len == c2.size() && (len == 0 || memcmp(c1.c_str(), c2.c_str(), len) == 0);
}
+// Hack here to avoid a global with a constructor; point to an unsigned short instead of a UChar.
+static unsigned short almostUChar;
+static UChar *const nonNullUCharPointer = reinterpret_cast<UChar *>(&almostUChar);
UString::Rep UString::Rep::null = { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
UString::Rep UString::Rep::null = { 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0 };
-UString::Rep UString::Rep::empty = { 0, 0, 1, 0, 0, 0, &dummy, 0, 0, 0, 0 };
+UString::Rep UString::Rep::empty = { 0, 0, 1, 0, 0, 0, nonNullUCharPointer, 0, 0, 0, 0 };
const int normalStatBufferSize = 4096;
static char *statBuffer = 0;
static int statBufferSize = 0;
const int normalStatBufferSize = 4096;
static char *statBuffer = 0;
static int statBufferSize = 0;