aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4globalobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-26 12:04:52 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-28 13:33:46 +0200
commitd2e2a5b59c617e6cf7236cf36e9c20fe9ea36fdb (patch)
tree1fc21beff4add85e68a61b7c88b5d5f928bec6e8 /src/qml/jsruntime/qv4globalobject.cpp
parent18d4794e3f614eec8594f6636d569af8bc112618 (diff)
Remove Value::fromString()
replaced with call to the GC safe ExceutionEngine::newString() method. Change-Id: I7258296e75ca724ff42b94a0d147bc33a05f8f68 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4globalobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4globalobject.cpp16
1 files changed, 8 insertions, 8 deletions
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();
}