1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 13:37:10 +09: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:
Andreas Kling 2025-04-28 02:04:54 +02:00 committed by Tim Flynn
parent 6ec4d0f5ba
commit b4554c01db
Notes: github-actions[bot] 2025-04-28 14:40:45 +00:00

View file

@ -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());