summaryrefslogtreecommitdiffstats
path: root/JavaScriptCore/runtime/StringConstructor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'JavaScriptCore/runtime/StringConstructor.cpp')
-rw-r--r--JavaScriptCore/runtime/StringConstructor.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/JavaScriptCore/runtime/StringConstructor.cpp b/JavaScriptCore/runtime/StringConstructor.cpp
index c1484c5..f02ab09 100644
--- a/JavaScriptCore/runtime/StringConstructor.cpp
+++ b/JavaScriptCore/runtime/StringConstructor.cpp
@@ -40,11 +40,11 @@ static NEVER_INLINE JSValue stringFromCharCodeSlowCase(ExecState* exec)
return jsString(exec, impl);
}
-static JSValue JSC_HOST_CALL stringFromCharCode(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL stringFromCharCode(ExecState* exec)
{
if (LIKELY(exec->argumentCount() == 1))
- return jsSingleCharacterString(exec, exec->argument(0).toUInt32(exec));
- return stringFromCharCodeSlowCase(exec);
+ return JSValue::encode(jsSingleCharacterString(exec, exec->argument(0).toUInt32(exec)));
+ return JSValue::encode(stringFromCharCodeSlowCase(exec));
}
ASSERT_CLASS_FITS_IN_CELL(StringConstructor);
@@ -66,11 +66,11 @@ StringConstructor::StringConstructor(ExecState* exec, JSGlobalObject* globalObje
}
// ECMA 15.5.2
-static JSObject* constructWithStringConstructor(ExecState* exec, JSObject*, const ArgList& args)
+static EncodedJSValue JSC_HOST_CALL constructWithStringConstructor(ExecState* exec)
{
- if (args.isEmpty())
- return new (exec) StringObject(exec, exec->lexicalGlobalObject()->stringObjectStructure());
- return new (exec) StringObject(exec, exec->lexicalGlobalObject()->stringObjectStructure(), args.at(0).toString(exec));
+ if (!exec->argumentCount())
+ return JSValue::encode(new (exec) StringObject(exec, exec->lexicalGlobalObject()->stringObjectStructure()));
+ return JSValue::encode(new (exec) StringObject(exec, exec->lexicalGlobalObject()->stringObjectStructure(), exec->argument(0).toString(exec)));
}
ConstructType StringConstructor::getConstructData(ConstructData& constructData)
@@ -80,11 +80,11 @@ ConstructType StringConstructor::getConstructData(ConstructData& constructData)
}
// ECMA 15.5.1
-static JSValue JSC_HOST_CALL callStringConstructor(ExecState* exec)
+static EncodedJSValue JSC_HOST_CALL callStringConstructor(ExecState* exec)
{
if (!exec->argumentCount())
- return jsEmptyString(exec);
- return jsString(exec, exec->argument(0).toString(exec));
+ return JSValue::encode(jsEmptyString(exec));
+ return JSValue::encode(jsString(exec, exec->argument(0).toString(exec)));
}
CallType StringConstructor::getCallData(CallData& callData)