diff options
Diffstat (limited to 'JavaScriptCore/API/JSClassRef.cpp')
-rw-r--r-- | JavaScriptCore/API/JSClassRef.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/JavaScriptCore/API/JSClassRef.cpp b/JavaScriptCore/API/JSClassRef.cpp index 717488f..3e65b75 100644 --- a/JavaScriptCore/API/JSClassRef.cpp +++ b/JavaScriptCore/API/JSClassRef.cpp @@ -33,6 +33,7 @@ #include <runtime/JSGlobalObject.h> #include <runtime/ObjectPrototype.h> #include <runtime/Identifier.h> +#include <wtf/text/StringHash.h> #include <wtf/unicode/UTF8.h> using namespace std; @@ -111,7 +112,8 @@ OpaqueJSClass::OpaqueJSClass(const JSClassDefinition* definition, OpaqueJSClass* OpaqueJSClass::~OpaqueJSClass() { - ASSERT(!m_className.rep()->isIdentifier()); + // The empty string is shared across threads & is an identifier, in all other cases we should have done a deep copy in className(), below. + ASSERT(!m_className.size() || !m_className.rep()->isIdentifier()); if (m_staticValues) { OpaqueJSClassStaticValuesTable::const_iterator end = m_staticValues->end(); @@ -171,7 +173,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass) ASSERT(!it->first->isIdentifier()); // Use a local variable here to sidestep an RVCT compiler bug. StaticValueEntry* entry = new StaticValueEntry(it->second->getProperty, it->second->setProperty, it->second->attributes); - staticValues->add(UString::Rep::create(it->first->data(), it->first->length()), entry); + staticValues->add(UString::Rep::create(it->first->characters(), it->first->length()), entry); } } else staticValues = 0; @@ -183,7 +185,7 @@ OpaqueJSClassContextData::OpaqueJSClassContextData(OpaqueJSClass* jsClass) ASSERT(!it->first->isIdentifier()); // Use a local variable here to sidestep an RVCT compiler bug. StaticFunctionEntry* entry = new StaticFunctionEntry(it->second->callAsFunction, it->second->attributes); - staticFunctions->add(UString::Rep::create(it->first->data(), it->first->length()), entry); + staticFunctions->add(UString::Rep::create(it->first->characters(), it->first->length()), entry); } } else |