QV4::Function: Reduce nFormals to 16 bits
This saves some space due to better alignment. We cannot have more bits in the compilation unit anyway. If we were to get a signal with more formal parameters than that, we just produce an error now. Change-Id: I02c329590b2d18337eca7441529b5cd4e19349f7 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
parent
ac0468f929
commit
b101be9be6
|
@ -78,8 +78,8 @@ public:
|
|||
|
||||
// first nArguments names in internalClass are the actual arguments
|
||||
Heap::InternalClass *internalClass;
|
||||
uint nFormals;
|
||||
int interpreterCallCount = 0;
|
||||
quint16 nFormals;
|
||||
bool isEval = false;
|
||||
bool detectedInjectedParameters = false;
|
||||
|
||||
|
|
|
@ -743,13 +743,17 @@ QString QQmlPropertyCache::signalParameterStringForJS(QV4::ExecutionEngine *engi
|
|||
const QSet<QString> &illegalNames = engine->illegalNames();
|
||||
QString parameters;
|
||||
|
||||
for (int i = 0; i < parameterNameList.count(); ++i) {
|
||||
const qsizetype count = parameterNameList.count();
|
||||
if (count > std::numeric_limits<quint16>::max())
|
||||
*errorString = QCoreApplication::translate("QQmlRewrite", "Signal has an excessive number of parameters: %1").arg(count);
|
||||
|
||||
for (qsizetype i = 0; i < count; ++i) {
|
||||
if (i > 0)
|
||||
parameters += QLatin1Char(',');
|
||||
const QByteArray ¶m = parameterNameList.at(i);
|
||||
if (param.isEmpty())
|
||||
if (param.isEmpty()) {
|
||||
unnamedParameter = true;
|
||||
else if (unnamedParameter) {
|
||||
} else if (unnamedParameter) {
|
||||
if (errorString)
|
||||
*errorString = QCoreApplication::translate("QQmlRewrite", "Signal uses unnamed parameter followed by named parameter.");
|
||||
return QString();
|
||||
|
|
Loading…
Reference in New Issue