mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-16 05:51:55 +00:00
LibJS: Make JS parser emit accurate this
insights for constructors
This way we don't have to handle it when instantiating the constructor.
This commit is contained in:
parent
9c0b185ab8
commit
ef4e7b7945
Notes:
github-actions[bot]
2025-04-08 16:54:10 +00:00
Author: https://github.com/awesomekling
Commit: ef4e7b7945
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4283
Reviewed-by: https://github.com/Hendiadyoin1
Reviewed-by: https://github.com/trflynn89
3 changed files with 14 additions and 6 deletions
|
@ -346,9 +346,6 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> ClassExpression::create_class_const
|
|||
|
||||
// FIXME: Step 14.a is done in the parser. By using a synthetic super(...args) which does not call @@iterator of %Array.prototype%
|
||||
auto const& constructor = *m_constructor;
|
||||
auto parsing_insights = constructor.parsing_insights();
|
||||
parsing_insights.uses_this_from_environment = true;
|
||||
parsing_insights.uses_this = true;
|
||||
auto class_constructor = ECMAScriptFunctionObject::create(
|
||||
realm,
|
||||
constructor.name(),
|
||||
|
@ -361,7 +358,7 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> ClassExpression::create_class_const
|
|||
vm.running_execution_context().private_environment,
|
||||
constructor.kind(),
|
||||
constructor.is_strict_mode(),
|
||||
parsing_insights,
|
||||
constructor.parsing_insights(),
|
||||
constructor.is_arrow_function());
|
||||
|
||||
class_constructor->set_name(class_name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue