diff options
author | Andreas Kling <kling@serenityos.org> | 2020-08-07 09:41:04 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-08-07 09:41:04 +0200 |
commit | c29681cb03078578a538fd15eeecea73ff528a6b (patch) | |
tree | d10523ed3d8c9ccb60438a0da4a07a22ff9e6498 /Shell | |
parent | e9c602bc83610f88bcbaa0aa9bb4f0bb31702bf3 (diff) | |
download | serenity-c29681cb03078578a538fd15eeecea73ff528a6b.zip |
Shell: Make VariableDeclarations::Variable store NonnullRefPtrs
Diffstat (limited to 'Shell')
-rw-r--r-- | Shell/AST.h | 4 | ||||
-rw-r--r-- | Shell/Parser.cpp | 2 |
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)); |