mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:27:35 +00:00
Libraries: Use AK::Variant default initialization where appropriate
This commit is contained in:
parent
98a0f9c0bd
commit
32e98d0924
8 changed files with 12 additions and 12 deletions
|
@ -317,8 +317,8 @@ struct BindingPattern : RefCounted<BindingPattern> {
|
|||
// This covers both BindingProperty and BindingElement, hence the more generic name
|
||||
struct BindingEntry {
|
||||
// If this entry represents a BindingElement, then name will be Empty
|
||||
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<Expression>, Empty> name { Empty {} };
|
||||
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> alias { Empty {} };
|
||||
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<Expression>, Empty> name {};
|
||||
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> alias {};
|
||||
RefPtr<Expression> initializer {};
|
||||
bool is_rest { false };
|
||||
|
||||
|
|
|
@ -2180,7 +2180,7 @@ NonnullRefPtr<VariableDeclaration> Parser::parse_variable_declaration(bool for_l
|
|||
|
||||
NonnullRefPtrVector<VariableDeclarator> declarations;
|
||||
for (;;) {
|
||||
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> target { Empty() };
|
||||
Variant<NonnullRefPtr<Identifier>, NonnullRefPtr<BindingPattern>, Empty> target {};
|
||||
if (match_identifier()) {
|
||||
auto identifier_start = push_start();
|
||||
auto name = consume_identifier().value();
|
||||
|
|
|
@ -239,7 +239,7 @@ private:
|
|||
String m_message;
|
||||
StringView m_trivia;
|
||||
StringView m_original_value;
|
||||
Variant<Empty, StringView, FlyString> m_value { Empty {} };
|
||||
Variant<Empty, StringView, FlyString> m_value {};
|
||||
StringView m_filename;
|
||||
size_t m_line_number { 0 };
|
||||
size_t m_line_column { 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue