summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-07 09:41:04 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-07 09:41:04 +0200
commitc29681cb03078578a538fd15eeecea73ff528a6b (patch)
treed10523ed3d8c9ccb60438a0da4a07a22ff9e6498
parente9c602bc83610f88bcbaa0aa9bb4f0bb31702bf3 (diff)
downloadserenity-c29681cb03078578a538fd15eeecea73ff528a6b.zip
Shell: Make VariableDeclarations::Variable store NonnullRefPtrs
-rw-r--r--Shell/AST.h4
-rw-r--r--Shell/Parser.cpp2
2 files changed, 3 insertions, 3 deletions
diff --git a/Shell/AST.h b/Shell/AST.h
index 13d97c725d..99da564861 100644
--- a/Shell/AST.h
+++ b/Shell/AST.h
@@ -861,8 +861,8 @@ private:
class VariableDeclarations final : public Node {
public:
struct Variable {
- RefPtr<Node> name;
- RefPtr<Node> value;
+ NonnullRefPtr<Node> name;
+ NonnullRefPtr<Node> value;
};
VariableDeclarations(Position, Vector<Variable> variables);
virtual ~VariableDeclarations();
diff --git a/Shell/Parser.cpp b/Shell/Parser.cpp
index fd434162e5..d0eccb2867 100644
--- a/Shell/Parser.cpp
+++ b/Shell/Parser.cpp
@@ -247,7 +247,7 @@ RefPtr<AST::Node> Parser::parse_variable_decls()
}
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())
return create<AST::VariableDeclarations>(move(variables));