[Sass] Fix a bug in css2sass exposed by css2sass_test.
This commit is contained in:
parent
ef2095a7cb
commit
9571d9af29
|
@ -377,7 +377,7 @@ module Sass
|
|||
def fold_commas(root)
|
||||
prev_rule = nil
|
||||
root.children.map! do |child|
|
||||
next child unless Tree::RuleNode === child
|
||||
next child unless child.is_a?(Tree::RuleNode)
|
||||
|
||||
if prev_rule && prev_rule.children == child.children
|
||||
prev_rule.rule << ", #{child.rule}"
|
||||
|
|
|
@ -9,6 +9,10 @@ module Sass::Tree
|
|||
super(value, style)
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
self.class == other.class && name == other.name && super
|
||||
end
|
||||
|
||||
def to_s(tabs, parent_name = nil)
|
||||
if value[-1] == ?;
|
||||
raise Sass::SyntaxError.new("Invalid attribute: #{declaration.dump} (This isn't CSS!).", @line)
|
||||
|
|
|
@ -17,6 +17,10 @@ module Sass
|
|||
@children << child
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
self.class == other.class && other.children == children
|
||||
end
|
||||
|
||||
def to_s
|
||||
result = String.new
|
||||
children.each do |child|
|
||||
|
|
|
@ -9,6 +9,10 @@ module Sass::Tree
|
|||
alias_method :rule, :value
|
||||
alias_method :rule=, :value=
|
||||
|
||||
def ==(other)
|
||||
self.class == other.class && rules == other.rules && super
|
||||
end
|
||||
|
||||
def rules
|
||||
Array(rule)
|
||||
end
|
||||
|
|
|
@ -9,6 +9,10 @@ module Sass::Tree
|
|||
super(style)
|
||||
end
|
||||
|
||||
def ==(other)
|
||||
self.class == other.class && value == other.value && super
|
||||
end
|
||||
|
||||
def to_s(tabs = 0)
|
||||
value
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue