diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-30 14:38:01 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-09-01 12:30:30 +0000 |
commit | 50828bc6ed9112956170a68dffe72431a21fddd9 (patch) | |
tree | 60cd60e614516fb77fe27fe7dc9a4f453b6e2b31 /src/qml/jsruntime/qv4functionobject.cpp | |
parent | 85fe2814a1397a17804d8eace4a70e5b7df854b6 (diff) |
Use the context member in CallData
Store the current context in the context member instead of
passing it along as arguments.
Change-Id: If3dd0d32eddb2a02bcbf65fe6e8d15142403170e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 218e591486..724d41be82 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -368,7 +368,8 @@ ReturnedValue ScriptFunction::construct(const Managed *that, CallData *callData) QV4::Function *v4Function = f->function(); Q_ASSERT(v4Function); - ReturnedValue result = v4Function->call(f->scope(), callData); + callData->context = f->scope(); +ReturnedValue result = v4Function->call(callData); if (Q_UNLIKELY(v4->hasException)) return Encode::undefined(); @@ -388,7 +389,8 @@ ReturnedValue ScriptFunction::call(const Managed *that, CallData *callData) QV4::Function *v4Function = f->function(); Q_ASSERT(v4Function); - return v4Function->call(f->scope(), callData); + callData->context = f->scope(); + return v4Function->call(callData); } void Heap::ScriptFunction::init(QV4::ExecutionContext *scope, Function *function) |