mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-27 18:17:22 +02: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:
committed by
Andreas Kling
parent
9c0b185ab8
commit
ef4e7b7945
Notes:
github-actions[bot]
2025-04-08 16:54:10 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/ef4e7b79451 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4283 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/trflynn89
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user