From 2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Mon, 7 May 2012 11:21:11 +0200 Subject: Imported WebKit commit 7e538425aa020340619e927792f3d895061fb54b (http://svn.webkit.org/repository/webkit/trunk@116286) --- Source/JavaScriptCore/runtime/JSValue.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSValue.cpp') diff --git a/Source/JavaScriptCore/runtime/JSValue.cpp b/Source/JavaScriptCore/runtime/JSValue.cpp index 36697c60c..088f214b9 100644 --- a/Source/JavaScriptCore/runtime/JSValue.cpp +++ b/Source/JavaScriptCore/runtime/JSValue.cpp @@ -260,19 +260,20 @@ bool JSValue::isValidCallee() JSString* JSValue::toStringSlowCase(ExecState* exec) const { + JSGlobalData& globalData = exec->globalData(); ASSERT(!isString()); if (isInt32()) - return jsString(&exec->globalData(), exec->globalData().numericStrings.add(asInt32())); + return jsString(&globalData, globalData.numericStrings.add(asInt32())); if (isDouble()) - return jsString(&exec->globalData(), exec->globalData().numericStrings.add(asDouble())); + return jsString(&globalData, globalData.numericStrings.add(asDouble())); if (isTrue()) - return jsNontrivialString(exec, exec->propertyNames().trueKeyword.ustring()); + return globalData.smallStrings.trueString(&globalData); if (isFalse()) - return jsNontrivialString(exec, exec->propertyNames().falseKeyword.ustring()); + return globalData.smallStrings.falseString(&globalData); if (isNull()) - return jsNontrivialString(exec, exec->propertyNames().nullKeyword.ustring()); + return globalData.smallStrings.nullString(&globalData); if (isUndefined()) - return jsNontrivialString(exec, exec->propertyNames().undefined.ustring()); + return globalData.smallStrings.undefinedString(&globalData); ASSERT(isCell()); JSValue value = asCell()->toPrimitive(exec, PreferString); @@ -282,4 +283,9 @@ JSString* JSValue::toStringSlowCase(ExecState* exec) const return value.toString(exec); } +UString JSValue::toUStringSlowCase(ExecState* exec) const +{ + return inlineJSValueNotStringtoUString(*this, exec); +} + } // namespace JSC -- cgit v1.2.1