Fix thisObject for all builtin function calls
authorSimon Hausmann <simon.hausmann@digia.com>
Tue, 22 Jan 2013 14:20:35 +0000 (15:20 +0100)
committerLars Knoll <lars.knoll@digia.com>
Tue, 22 Jan 2013 15:14:35 +0000 (16:14 +0100)
commit461c1ef24ea71a3994c931bda8c75c35c66968f5
treef82b318467ffe108c3d95bb0edd787260d97215e
parent6fb0f5c1b8b4aa36699549d193ff2b5c07033833
Fix thisObject for all builtin function calls

Even when doing

    var v = Object.prototype.valueOf;
    v();

the thisObject must not be converted to the global object automatically, i.e.
remain null. We previously implemented this lack of conversion for apply() and
call(), but it does in fact apply to all built-in functions.

Consequently we can get rid of callDirect and the virtual maybeAdjustThisObject
function and instead just do the "tweak" with the help of a little boolean.

Change-Id: I93bc37f4c6e896d6dcf169aa74953b0e460312ce
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
qv4functionobject.cpp
qv4functionobject.h
qv4managed.h
tests/TestExpectations