Fix failing assertion (index != -1) when trying to re-declare a function parameter
authorSimon Hausmann <simon.hausmann@digia.com>
Fri, 11 Oct 2013 12:56:15 +0000 (14:56 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 11 Oct 2013 17:39:35 +0000 (19:39 +0200)
commit74a02a83809f6942732ec18125403e8ee32c574f
treea8fbfd235ea7dbf3674e8e59fcfb762b8b7a9944
parent6adb0693a2e408c388a0939e0a3d711da7b651df
Fix failing assertion (index != -1) when trying to re-declare a function parameter

Testcase: (covered in parserstress)

function foo(x) {
    var x = 42;
}

In variableDeclaration, the lookup for "x" with findMember will return -1, and
instead code for checking against arguments using indexOfArgument is needed.
The easiest fix is to simply use identifier(), which handles this accordingly.

Change-Id: I6a738d6196d4bff1fc987f111aebbaa83ed8f88f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/qml/compiler/qv4codegen.cpp