Fix visibility of named function expressions in surrounding environment
Quoting from the spec: "However, unlike in a FunctionDeclaration, the
Identifier in a FunctionExpression cannot be referenced from and does not
affect the scope enclosing the FunctionExpression."
This was visible in QML start-up when evaluating helper functions: "(function
foo() { ...})" was compiled and run in the global scope and the returned
funtcion expression is executed later on. However we incorrectly also ended up
entering "foo" as a name into the global scope (which it was executed in),
causing then for example "foo" to become part of the "illegal" names in QML.
The case at point was that qv8sequencewrapper.cpp evaluates a helper script
with a named function expression "compare" and then later the QML canvas
auto-test failed because somewhere it declared a JS function in the scope
of a QML item called "compare".
All tests still pass, we do handle the case of looking up the named function
already in qv4context.cpp (getProperty, etc.).
Change-Id: Id9daaff355ce35ae4bc96dcbaba9710cd8cc2211
Reviewed-by: Lars Knoll <lars.knoll@digia.com>