mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-14 10:59:24 +02:00
When a function has parameter expressions (e.g. destructured params with defaults), CreateVariableEnvironment creates a separate variable environment for function declarations and sets it as the current lexical environment at runtime. However, the bytecode generator's m_lexical_environment_register_stack was not updated to reflect this, so subsequent CreateLexicalEnvironment ops would parent themselves to the old (pre-variable-environment) lexical environment, skipping the variable environment entirely. This meant function declarations hoisted into the variable environment were invisible to closures created in the function body. Fix this by capturing the new lexical environment into a register after CreateVariableEnvironment and pushing it onto the environment register stack. This fixes a problem where https://tumblr.com/ wouldn't load the feed.
81 KiB
81 KiB