1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:57:44 +00:00

LibJS: Identify global variables during parsing

Identifying global variables during parsing will make it possible to
generate special optimized instruction to access them in upcoming
changes.
This commit is contained in:
Aliaksandr Kalenik 2023-07-12 04:02:27 +02:00 committed by Andreas Kling
parent 73f1c7a030
commit b0a533dbc0
5 changed files with 75 additions and 20 deletions

View file

@ -316,8 +316,10 @@ private:
bool allow_super_property_lookup { false };
bool allow_super_constructor_call { false };
bool in_function_context { false };
bool initiated_by_eval { false };
bool in_eval_function_context { false }; // This controls if we allow new.target or not. Note that eval("return") is not allowed, so we have to have a separate state variable for eval.
bool in_formal_parameter_context { false };
bool in_catch_parameter_context { false };
bool in_generator_function_context { false };
bool await_expression_is_valid { false };
bool in_arrow_function_context { false };