ladybird/Userland/Libraries/LibJS/Tests/functions
Linus Groh a92dc4e30d LibJS: Ensure function declarations don't leak outside function scopes
When using VM::set_variable() to put the created ScriptFunction onto a
ScopeObject, we would previously unexpectedly reach the global object as
set_variable() checks each traversed scope for an existing Variable with
the given name - which would cause a leak of the inner function past the
outer function (we even had a test expecting that behaviour!). Now we
first declare functions (as DeclarationKind::Var) before setting them.
This will need some more work to make hoisting across non-lexical scopes
work, but it fixes this specific issue for now.

Fixes #6766.
2021-05-13 23:59:00 +01:00
..
arrow-functions.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
constructor-basic.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-default-parameters.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-duplicate-parameters.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-hoisting.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-length.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-missing-arg.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-name.js Only apply auto-naming of function expressions based on syntax 2021-03-22 12:44:07 +01:00
function-nesting.js LibJS: Ensure function declarations don't leak outside function scopes 2021-05-13 23:59:00 +01:00
function-new-target.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-prototype-writable.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-rest-params.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-spread.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-strict-mode.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-this-in-arguments.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
function-TypeError.js Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00