diff options
-rw-r--r-- | src/qml/compiler/qv4compilerscanfunctions.cpp | 15 | ||||
-rw-r--r-- | tests/auto/qml/ecmascripttests/TestExpectations | 1 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/qml/compiler/qv4compilerscanfunctions.cpp b/src/qml/compiler/qv4compilerscanfunctions.cpp index 5d3a7a6d8c..349bd08dcf 100644 --- a/src/qml/compiler/qv4compilerscanfunctions.cpp +++ b/src/qml/compiler/qv4compilerscanfunctions.cpp @@ -656,13 +656,16 @@ void ScanFunctions::calcEscapingVariables() Module *m = _cg->_module; for (Context *inner : qAsConst(m->contextMap)) { - if (inner->contextType == ContextType::Block && inner->usesArgumentsObject == Context::ArgumentsObjectUsed) { - Context *c = inner->parent; - while (c->contextType == ContextType::Block) - c = c->parent; + if (inner->usesArgumentsObject != Context::ArgumentsObjectUsed) + continue; + if (inner->contextType != ContextType::Block && !inner->isArrowFunction) + continue; + Context *c = inner->parent; + while (c && (c->contextType == ContextType::Block || c->isArrowFunction)) + c = c->parent; + if (c) c->usesArgumentsObject = Context::ArgumentsObjectUsed; - inner->usesArgumentsObject = Context::ArgumentsObjectNotUsed; - } + inner->usesArgumentsObject = Context::ArgumentsObjectNotUsed; } for (Context *inner : qAsConst(m->contextMap)) { if (!inner->parent || inner->usesArgumentsObject == Context::ArgumentsObjectUnknown) diff --git a/tests/auto/qml/ecmascripttests/TestExpectations b/tests/auto/qml/ecmascripttests/TestExpectations index bcb6729ab6..afefb5fa26 100644 --- a/tests/auto/qml/ecmascripttests/TestExpectations +++ b/tests/auto/qml/ecmascripttests/TestExpectations @@ -664,7 +664,6 @@ language/eval-code/indirect/var-env-var-non-strict.js strictFails language/expressions/arrow-function/cannot-override-this-with-thisArg.js fails language/expressions/arrow-function/dflt-params-ref-later.js fails language/expressions/arrow-function/dflt-params-ref-self.js fails -language/expressions/arrow-function/lexical-arguments.js fails language/expressions/arrow-function/lexical-new.target-closure-returned.js fails language/expressions/arrow-function/lexical-new.target.js fails language/expressions/arrow-function/lexical-super-call-from-within-constructor.js fails |