diff options
| author | Lars Knoll <lars.knoll@qt.io> | 2018-03-15 22:33:11 +0100 |
|---|---|---|
| committer | Lars Knoll <lars.knoll@qt.io> | 2018-04-26 20:27:05 +0000 |
| commit | a1e5364b492610adf0636fefa3fc400558e211b6 (patch) | |
| tree | 3c4fa3d591e1f5254b52dbe2f3e215417205e803 /src/qml/compiler/qv4compileddata.cpp | |
| parent | 783088c3a49e3c344dbd4566cc6ed5dd30c27f31 (diff) | |
Fix length property of Function objects
According to ES6, the length property is the number of
required arguments, ie. the number of arguments until the
first arg that has adefault parameter.
Also fix a crash when parsing a parameterlist with a trailing comma.
Change-Id: I4f6b2be4feae7b513388be66b43b160bb3cc77f1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4compileddata.cpp')
| -rw-r--r-- | src/qml/compiler/qv4compileddata.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp index 8f8514535a..59c37fb6c7 100644 --- a/src/qml/compiler/qv4compileddata.cpp +++ b/src/qml/compiler/qv4compileddata.cpp @@ -520,6 +520,7 @@ Unit *CompilationUnit::createUnitData(QmlIR::Document *irDocument) signalParameterNameTable.append(stringTable.getStringId(arg)); function->nFormals = formals.size(); + function->length = function->nFormals; // Hack to ensure an activation is created. function->flags |= QV4::CompiledData::Function::HasCatchOrWith | QV4::CompiledData::Function::HasDirectEval; |
