mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibJS: Mark ESFO path for [[Call]] on a class constructor [[unlikely]]
This is an exception path that's not supposed to be called normally, so let's mark it unlikely.
This commit is contained in:
Notes:
github-actions[bot]
2025-04-28 14:40:45 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/b4554c01db5 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4502
@@ -516,7 +516,7 @@ FLATTEN ThrowCompletionOr<Value> ECMAScriptFunctionObject::internal_call(Executi
|
||||
ASSERT(&vm.running_execution_context() == &callee_context);
|
||||
|
||||
// 4. If F.[[IsClassConstructor]] is true, then
|
||||
if (is_class_constructor()) {
|
||||
if (is_class_constructor()) [[unlikely]] {
|
||||
// a. Let error be a newly created TypeError object.
|
||||
// b. NOTE: error is created in calleeContext with F's associated Realm Record.
|
||||
auto throw_completion = vm.throw_completion<TypeError>(ErrorType::ClassConstructorWithoutNew, name());
|
||||
|
||||
Reference in New Issue
Block a user