+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.
return len == c2.size() && (len == 0 || memcmp(c1.c_str(), c2.c_str(), len) == 0);
}
-static UChar dummy;
+// 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::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;