diff options
author | Lars Knoll <[email protected]> | 2017-08-03 20:26:28 +0200 |
---|---|---|
committer | Lars Knoll <[email protected]> | 2017-08-04 07:08:19 +0000 |
commit | c0f961cd6b82a523e277f6d8778a20508b15697d (patch) | |
tree | 7e4986686630404123a9f40eeb4881a089072d12 /src/qml/jsruntime/qv4argumentsobject.cpp | |
parent | b46b2e28b39443f6250c0d751a593b35af1c8c1e (diff) |
Change function signatures for call/construct back
Change those back again to return a value. This will be required
to avoid creation of Scope objects between JS function calls.
Change-Id: I05cb5cf8fd0c13dcefa60d213ccd5983fab57ea3
Reviewed-by: Erik Verbruggen <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4argumentsobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4argumentsobject.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/qml/jsruntime/qv4argumentsobject.cpp b/src/qml/jsruntime/qv4argumentsobject.cpp index 0905c2828a..5d1d322f7b 100644 --- a/src/qml/jsruntime/qv4argumentsobject.cpp +++ b/src/qml/jsruntime/qv4argumentsobject.cpp @@ -138,7 +138,7 @@ bool ArgumentsObject::defineOwnProperty(ExecutionEngine *engine, uint index, con ScopedCallData callData(scope, 1); callData->thisObject = this->asReturnedValue(); callData->args[0] = desc->value; - setter->call(scope, callData); + setter->call(callData); if (attrs.isWritable()) { setArrayAttributes(index, mapAttrs); @@ -205,35 +205,33 @@ PropertyAttributes ArgumentsObject::queryIndexed(const Managed *m, uint index) DEFINE_OBJECT_VTABLE(ArgumentsGetterFunction); -void ArgumentsGetterFunction::call(const Managed *getter, Scope &scope, CallData *callData) +ReturnedValue ArgumentsGetterFunction::call(const Managed *getter, CallData *callData) { ExecutionEngine *v4 = static_cast<const ArgumentsGetterFunction *>(getter)->engine(); + Scope scope(v4); Scoped<ArgumentsGetterFunction> g(scope, static_cast<const ArgumentsGetterFunction *>(getter)); Scoped<ArgumentsObject> o(scope, callData->thisObject.as<ArgumentsObject>()); - if (!o) { - scope.result = v4->throwTypeError(); - return; - } + if (!o) + return v4->throwTypeError(); Q_ASSERT(g->index() < static_cast<unsigned>(o->context()->callData->argc)); - scope.result = o->context()->callData->args[g->index()]; + return o->context()->callData->args[g->index()].asReturnedValue(); } DEFINE_OBJECT_VTABLE(ArgumentsSetterFunction); -void ArgumentsSetterFunction::call(const Managed *setter, Scope &scope, CallData *callData) +ReturnedValue ArgumentsSetterFunction::call(const Managed *setter, CallData *callData) { ExecutionEngine *v4 = static_cast<const ArgumentsSetterFunction *>(setter)->engine(); + Scope scope(v4); Scoped<ArgumentsSetterFunction> s(scope, static_cast<const ArgumentsSetterFunction *>(setter)); Scoped<ArgumentsObject> o(scope, callData->thisObject.as<ArgumentsObject>()); - if (!o) { - scope.result = v4->throwTypeError(); - return; - } + if (!o) + return v4->throwTypeError(); Q_ASSERT(s->index() < static_cast<unsigned>(o->context()->callData->argc)); o->context()->callData->args[s->index()] = callData->argc ? callData->args[0].asReturnedValue() : Encode::undefined(); - scope.result = Encode::undefined(); + return Encode::undefined(); } uint ArgumentsObject::getLength(const Managed *m) |