aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4stringobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-11 15:09:25 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-18 13:13:30 +0200
commit8d26084ae56ba5aedd73ab733553dbf9cb3eb672 (patch)
treec0c14b3fdb87bdb23d5612de77605b98aa03dd52 /src/qml/jsruntime/qv4stringobject.cpp
parent4691396f96cf8468a9ee4fbb339cc94e339928a7 (diff)
Use ReturnedValue for Managed::construct()
Change-Id: I9e702d60c4e1b7ba19a699ff7a8d53876d6cd5f7 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4stringobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4stringobject.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4stringobject.cpp b/src/qml/jsruntime/qv4stringobject.cpp
index 9faa1ebeae..8df40ea488 100644
--- a/src/qml/jsruntime/qv4stringobject.cpp
+++ b/src/qml/jsruntime/qv4stringobject.cpp
@@ -160,14 +160,14 @@ StringCtor::StringCtor(ExecutionContext *scope)
vtbl = &static_vtbl;
}
-Value StringCtor::construct(Managed *m, CallData *callData)
+ReturnedValue StringCtor::construct(Managed *m, CallData *callData)
{
Value value;
if (callData->argc)
value = Value::fromString(callData->args[0].toString(m->engine()->current));
else
value = Value::fromString(m->engine()->current, QString());
- return Value::fromObject(m->engine()->newStringObject(value));
+ return Value::fromObject(m->engine()->newStringObject(value)).asReturnedValue();
}
ReturnedValue StringCtor::call(Managed *m, CallData *callData)
@@ -359,7 +359,7 @@ Value StringPrototype::method_match(SimpleCallContext *context)
if (!rx) {
ScopedCallData callData(scope, 1);
callData->args[0] = regexp;
- rx = context->engine->regExpCtor.asFunctionObject()->construct(callData).as<RegExpObject>();
+ rx = Value::fromReturnedValue(context->engine->regExpCtor.asFunctionObject()->construct(callData)).as<RegExpObject>();
}
if (!rx)
@@ -573,13 +573,13 @@ Value StringPrototype::method_search(SimpleCallContext *ctx)
else
string = ctx->thisObject.toString(ctx)->toQString();
- Value regExpValue = ctx->argument(0);
- RegExpObject *regExp = regExpValue.as<RegExpObject>();
+ ScopedValue regExpValue(scope, ctx->argument(0));
+ RegExpObject *regExp = regExpValue->as<RegExpObject>();
if (!regExp) {
ScopedCallData callData(scope, 1);
callData->args[0] = regExpValue;
regExpValue = ctx->engine->regExpCtor.asFunctionObject()->construct(callData);
- regExp = regExpValue.as<RegExpObject>();
+ regExp = regExpValue->as<RegExpObject>();
}
uint* matchOffsets = (uint*)alloca(regExp->value->captureCount() * 2 * sizeof(uint));
uint result = regExp->value->match(string, /*offset*/0, matchOffsets);