diff options
Diffstat (limited to 'JavaScriptCore/runtime/JSString.h')
-rw-r--r-- | JavaScriptCore/runtime/JSString.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/JavaScriptCore/runtime/JSString.h b/JavaScriptCore/runtime/JSString.h index 5001b01..dec925d 100644 --- a/JavaScriptCore/runtime/JSString.h +++ b/JavaScriptCore/runtime/JSString.h @@ -327,11 +327,10 @@ namespace JSC { resolveRope(exec); return m_value; } - const UString tryGetValue() const + const UString& tryGetValue() const { - // If this is a rope, m_value should be null - - // if this is not a rope, m_value should be non-null. - ASSERT(isRope() == m_value.isNull()); + if (isRope()) + resolveRope(0); return m_value; } unsigned length() { return m_length; } @@ -498,7 +497,7 @@ namespace JSC { if (isRope()) return getIndexSlowCase(exec, i); ASSERT(i < m_value.size()); - return jsSingleCharacterSubstring(exec, value(exec), i); + return jsSingleCharacterSubstring(exec, m_value, i); } inline JSString* jsString(JSGlobalData* globalData, const UString& s) |