Fix identifier lookups when mixing variables and arguments
authorSimon Hausmann <simon.hausmann@digia.com>
Thu, 21 Mar 2013 19:41:05 +0000 (20:41 +0100)
committerLars Knoll <lars.knoll@digia.com>
Thu, 21 Mar 2013 21:45:23 +0000 (22:45 +0100)
commit0006255d847ebff402dc771092c115ae714d8e10
tree60dad642fc7187628ad5f298b80d63d6f0092a79
parent188db3422046bf49f283e08220f9c61f1fa3a233
Fix identifier lookups when mixing variables and arguments

Suppose the following test-case:

function outter() {
    var foo = "bar";
    function inner(foo) {
        function innerMost() {
            print(foo);
        }
        return innerMost();
    }
    inner("FOO");
}

When looking up "foo" in innerMost we used to find the variable foo in outter,
because our fast lookup optimization doesn't take function parameters in outter
scopes into account. However we are supposed to find the parameter "foo" from
inner's activation object.

This fixes the last issue with running the Boyer benchmark.

Change-Id: I645ed1c601aff835bc9b7ee1fcfbdfa9c295a70c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
src/v4/qv4codegen.cpp
src/v4/qv4codegen_p.h
src/v4/qv4jsir.cpp
src/v4/qv4jsir_p.h