lib/sass/tree/if_node.rb in haml-3.0.0.rc.3 vs lib/sass/tree/if_node.rb in haml-3.0.0.rc.4

- old
+ new

@@ -63,7 +63,19 @@ environment = Sass::Environment.new(environment) return perform_children(environment) if @expr.nil? || @expr.perform(environment).to_bool return @else.perform(environment) if @else [] end + + # Returns an error message if the given child node is invalid, + # and false otherwise. + # + # {ExtendNode}s are valid within {IfNode}s. + # + # @param child [Tree::Node] A potential child node. + # @return [Boolean, String] Whether or not the child node is valid, + # as well as the error message to display if it is invalid + def invalid_child?(child) + super unless child.is_a?(ExtendNode) + end end end