diff options
author | Ulf Hermann <[email protected]> | 2021-08-11 15:47:13 +0200 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2021-08-17 16:14:53 +0200 |
commit | 8cd7aabfb24b391143b3c358f49fb6a28765d5f3 (patch) | |
tree | bb1252651849f8cff7b444ebf82ebfb81a86ae5d /src/qml/jsruntime/qv4function_p.h | |
parent | d0dc91158d0b44d9e1b73c3b0dacdd6699741ad7 (diff) |
When binding signals, run the outer function to get the nested one
The outer function may perform important tasks like setting up a call
context with a "this" member for the nested function. In particular,
arrow functions retain their original "this" member, no matter where
they are executed later. We can detect this condition while generating
the compilation unit. If the outer function is not a simple wrapper that
only returns the inner function, execute it when binding a signal.
Fixes: QTBUG-95659
Pick-to: 6.2
Change-Id: I7dfef2c78378588e6bfc4bedde7889c7f2ce03ef
Reviewed-by: Yuya Nishihara <[email protected]>
Reviewed-by: Maximilian Goldstein <[email protected]>
Diffstat (limited to 'src/qml/jsruntime/qv4function_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4function_p.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h index 45f2a6263a..2c5de203b6 100644 --- a/src/qml/jsruntime/qv4function_p.h +++ b/src/qml/jsruntime/qv4function_p.h @@ -139,6 +139,7 @@ public: inline bool isStrict() const { return compiledFunction->flags & CompiledData::Function::IsStrict; } inline bool isArrowFunction() const { return compiledFunction->flags & CompiledData::Function::IsArrowFunction; } inline bool isGenerator() const { return compiledFunction->flags & CompiledData::Function::IsGenerator; } + inline bool isClosureWrapper() const { return compiledFunction->flags & CompiledData::Function::IsClosureWrapper; } QQmlSourceLocation sourceLocation() const; |