diff --git a/lib/liquid/parse_tree_visitor.rb b/lib/liquid/parse_tree_visitor.rb index c9c6646e1..6d23b2c50 100644 --- a/lib/liquid/parse_tree_visitor.rb +++ b/lib/liquid/parse_tree_visitor.rb @@ -36,7 +36,7 @@ def visit(context = nil) protected def children - @node.respond_to?(:nodelist) ? Array(@node.nodelist) : [] + @node.respond_to?(:nodelist) ? Array(@node.nodelist) : Const::EMPTY_ARRAY end end end diff --git a/lib/liquid/variable.rb b/lib/liquid/variable.rb index 1a4c07198..372ee4dbf 100644 --- a/lib/liquid/variable.rb +++ b/lib/liquid/variable.rb @@ -68,7 +68,7 @@ def strict_parse(markup) @name = parse_context.parse_expression(p.expression) while p.consume?(:pipe) filtername = p.consume(:id) - filterargs = p.consume?(:colon) ? parse_filterargs(p) : [] + filterargs = p.consume?(:colon) ? parse_filterargs(p) : Const::EMPTY_ARRAY @filters << parse_filter_expressions(filtername, filterargs) end p.consume(:end_of_string)