mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +00:00
LibJS: Make Completion.[[Value]] non-optional
Instead, just use js_undefined() whenever the [[Value]] field is unused. This avoids a whole bunch of presence checks.
This commit is contained in:
parent
c0600c4353
commit
de424d6879
Notes:
github-actions[bot]
2025-04-05 09:21:48 +00:00
Author: https://github.com/awesomekling
Commit: de424d6879
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4232
65 changed files with 225 additions and 250 deletions
|
@ -194,7 +194,7 @@ ThrowCompletionOr<ClassElement::ClassValue> ClassMethod::class_element_evaluatio
|
|||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
||||
return ClassValue { normal_completion({}) };
|
||||
return ClassValue { normal_completion(js_undefined()) };
|
||||
} else {
|
||||
auto& private_name = property_key_or_private_name.get<PrivateName>();
|
||||
switch (kind()) {
|
||||
|
@ -417,8 +417,7 @@ ThrowCompletionOr<ECMAScriptFunctionObject*> ClassExpression::create_class_const
|
|||
instance_fields.append(move(*class_field_definition_ptr));
|
||||
} else if (element->class_element_kind() == ClassElement::ElementKind::StaticInitializer) {
|
||||
// We use Completion to hold the ClassStaticBlockDefinition Record.
|
||||
VERIFY(element_value.has<Completion>() && element_value.get<Completion>().value().has_value());
|
||||
auto& element_object = element_value.get<Completion>().value()->as_object();
|
||||
auto& element_object = element_value.get<Completion>().value().as_object();
|
||||
VERIFY(is<ECMAScriptFunctionObject>(element_object));
|
||||
static_elements.append(GC::Ref { static_cast<ECMAScriptFunctionObject&>(element_object) });
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue