resolveQmlContextPropertyLookupGetter: Use ScopedPropertyKey
We already have a scope, and there is no guarantee that the various calls we do won't cause an allocation, and conseqently trigger the garbage collector Change-Id: I31db85e74b986c7d9f9d97b5d409e2030cd5f583 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> (cherry picked from commit85941a1014
) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commitea9bc31986
)
This commit is contained in:
parent
9a3ae2c1f9
commit
83cc248141
|
@ -475,8 +475,8 @@ ReturnedValue QQmlContextWrapper::resolveQmlContextPropertyLookupGetter(Lookup *
|
||||||
{
|
{
|
||||||
Scope scope(engine);
|
Scope scope(engine);
|
||||||
auto *func = engine->currentStackFrame->v4Function;
|
auto *func = engine->currentStackFrame->v4Function;
|
||||||
PropertyKey name =engine->identifierTable->asPropertyKey(
|
ScopedPropertyKey name(scope, engine->identifierTable->asPropertyKey(
|
||||||
func->compilationUnit->runtimeStrings[l->nameIndex]);
|
func->compilationUnit->runtimeStrings[l->nameIndex]));
|
||||||
|
|
||||||
// Special hack for bounded signal expressions, where the parameters of signals are injected
|
// Special hack for bounded signal expressions, where the parameters of signals are injected
|
||||||
// into the handler expression through the locals of the call context. So for onClicked: { ... }
|
// into the handler expression through the locals of the call context. So for onClicked: { ... }
|
||||||
|
@ -490,7 +490,7 @@ ReturnedValue QQmlContextWrapper::resolveQmlContextPropertyLookupGetter(Lookup *
|
||||||
const auto location = func->sourceLocation();
|
const auto location = func->sourceLocation();
|
||||||
qCWarning(lcQmlContext).nospace().noquote()
|
qCWarning(lcQmlContext).nospace().noquote()
|
||||||
<< location.sourceFile << ":" << location.line << ":" << location.column
|
<< location.sourceFile << ":" << location.line << ":" << location.column
|
||||||
<< " Parameter \"" << name.toQString() << "\" is not declared."
|
<< " Parameter \"" << name->toQString() << "\" is not declared."
|
||||||
<< " Injection of parameters into signal handlers is deprecated."
|
<< " Injection of parameters into signal handlers is deprecated."
|
||||||
<< " Use JavaScript functions with formal parameters instead.";
|
<< " Use JavaScript functions with formal parameters instead.";
|
||||||
|
|
||||||
|
@ -526,7 +526,7 @@ ReturnedValue QQmlContextWrapper::resolveQmlContextPropertyLookupGetter(Lookup *
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!hasProperty)
|
if (!hasProperty)
|
||||||
return engine->throwReferenceError(name.toQString());
|
return engine->throwReferenceError(name->toQString());
|
||||||
return result->asReturnedValue();
|
return result->asReturnedValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue