diff options
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore')
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/parser/SourcePoolQt.cpp | 2 | ||||
-rw-r--r-- | src/3rdparty/webkit/JavaScriptCore/runtime/UString.h | 38 |
2 files changed, 28 insertions, 12 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/parser/SourcePoolQt.cpp b/src/3rdparty/webkit/JavaScriptCore/parser/SourcePoolQt.cpp index 885e2d2..b8121d6 100644 --- a/src/3rdparty/webkit/JavaScriptCore/parser/SourcePoolQt.cpp +++ b/src/3rdparty/webkit/JavaScriptCore/parser/SourcePoolQt.cpp @@ -33,7 +33,7 @@ namespace JSC { { int id = source.provider()->asID(); - codes.insert(id,source.toString().toQString()); + codes.insert(id,source.toString()); currentScript.push(id); scriptRef.insert(id,ScriptActivCount()); diff --git a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h index 7edb994..0a53c50 100644 --- a/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h +++ b/src/3rdparty/webkit/JavaScriptCore/runtime/UString.h @@ -78,17 +78,6 @@ namespace JSC { public: -#if PLATFORM(QT) - - QString toQString() const - { - // Not sure with method is better, 2nd is shorter - //UString string - //QString::fromUtf8(string.toString().UTF8String().c_str()) - - return QString(reinterpret_cast<const QChar*>(this->data()), this->size()); - } -#endif typedef CrossThreadRefCounted<OwnFastMallocPtr<UChar> > SharedUChar; struct BaseString; struct Rep : Noncopyable { @@ -376,6 +365,19 @@ namespace JSC { return m_rep->reserveCapacity(capacity); } +#if PLATFORM(QT) + operator QString() const + { + return QString(reinterpret_cast<const QChar*>(this->data()), this->size()); + } + + UString(const QString& str) + { + *this = JSC::UString(reinterpret_cast<const UChar*>(str.constData()), str.length()); + } +#endif + + private: void expandCapacity(int requiredLength); void expandPreCapacity(int requiredPreCap); @@ -543,6 +545,20 @@ namespace JSC { return capacityDelta; } +#if PLATFORM(QT) + + inline UString operator+(const char* s1, const UString& s2) + { + return operator+(UString(s1), s2); + } + + inline UString operator+(const UString& s1, const char* s2) + { + return operator+(s1, UString(s2)); + } + +#endif + struct IdentifierRepHash : PtrHash<RefPtr<JSC::UString::Rep> > { static unsigned hash(const RefPtr<JSC::UString::Rep>& key) { return key->computedHash(); } static unsigned hash(JSC::UString::Rep* key) { return key->computedHash(); } |