1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-23 20:17:42 +00:00

Shell: Make VariableDeclarations::Variable store NonnullRefPtrs

This commit is contained in:
Andreas Kling 2020-08-07 09:41:04 +02:00
parent e9c602bc83
commit c29681cb03
2 changed files with 3 additions and 3 deletions

View file

@ -861,8 +861,8 @@ private:
class VariableDeclarations final : public Node { class VariableDeclarations final : public Node {
public: public:
struct Variable { struct Variable {
RefPtr<Node> name; NonnullRefPtr<Node> name;
RefPtr<Node> value; NonnullRefPtr<Node> value;
}; };
VariableDeclarations(Position, Vector<Variable> variables); VariableDeclarations(Position, Vector<Variable> variables);
virtual ~VariableDeclarations(); virtual ~VariableDeclarations();

View file

@ -247,7 +247,7 @@ RefPtr<AST::Node> Parser::parse_variable_decls()
} }
Vector<AST::VariableDeclarations::Variable> variables; Vector<AST::VariableDeclarations::Variable> variables;
variables.append({ move(name_expr), move(expression) }); variables.append({ move(name_expr), expression.release_nonnull() });
if (consume_while(is_whitespace).is_empty()) if (consume_while(is_whitespace).is_empty())
return create<AST::VariableDeclarations>(move(variables)); return create<AST::VariableDeclarations>(move(variables));