From d2e2a5b59c617e6cf7236cf36e9c20fe9ea36fdb Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Thu, 26 Sep 2013 12:04:52 +0200 Subject: Remove Value::fromString() replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann --- src/qml/jsruntime/qv4globalobject.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/qml/jsruntime/qv4globalobject.cpp') diff --git a/src/qml/jsruntime/qv4globalobject.cpp b/src/qml/jsruntime/qv4globalobject.cpp index 4cb351eeb0..856b85cc1c 100644 --- a/src/qml/jsruntime/qv4globalobject.cpp +++ b/src/qml/jsruntime/qv4globalobject.cpp @@ -605,7 +605,7 @@ ReturnedValue GlobalFunctions::method_decodeURI(SimpleCallContext *context) context->throwURIError(s); } - return Value::fromString(context, out).asReturnedValue(); + return context->engine->newString(out)->asReturnedValue(); } /// decodeURIComponent [15.1.3.2] @@ -623,7 +623,7 @@ ReturnedValue GlobalFunctions::method_decodeURIComponent(SimpleCallContext *cont context->throwURIError(s); } - return Value::fromString(context, out).asReturnedValue(); + return context->engine->newString(out)->asReturnedValue(); } /// encodeURI [15.1.3.3] @@ -641,7 +641,7 @@ ReturnedValue GlobalFunctions::method_encodeURI(SimpleCallContext *context) context->throwURIError(s); } - return Value::fromString(context, out).asReturnedValue(); + return context->engine->newString(out)->asReturnedValue(); } /// encodeURIComponent [15.1.3.4] @@ -659,23 +659,23 @@ ReturnedValue GlobalFunctions::method_encodeURIComponent(SimpleCallContext *cont context->throwURIError(s); } - return Value::fromString(context, out).asReturnedValue(); + return context->engine->newString(out)->asReturnedValue(); } ReturnedValue GlobalFunctions::method_escape(SimpleCallContext *context) { if (!context->callData->argc) - return Value::fromString(context, QStringLiteral("undefined")).asReturnedValue(); + return context->engine->newString(QStringLiteral("undefined"))->asReturnedValue(); QString str = context->callData->args[0].toString(context)->toQString(); - return Value::fromString(context, escape(str)).asReturnedValue(); + return context->engine->newString(escape(str))->asReturnedValue(); } ReturnedValue GlobalFunctions::method_unescape(SimpleCallContext *context) { if (!context->callData->argc) - return Value::fromString(context, QStringLiteral("undefined")).asReturnedValue(); + return context->engine->newString(QStringLiteral("undefined"))->asReturnedValue(); QString str = context->callData->args[0].toString(context)->toQString(); - return Value::fromString(context, unescape(str)).asReturnedValue(); + return context->engine->newString(unescape(str))->asReturnedValue(); } -- cgit v1.2.1