[Sass] Make Number#{gte,lt,lte} raise proper errors when used with non-Numbers.
This commit is contained in:
parent
ad36db1346
commit
05bf43915c
|
@ -77,17 +77,17 @@ module Sass::Script
|
|||
end
|
||||
|
||||
def gte(other)
|
||||
raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
|
||||
raise NoMethodError.new(nil, :gte) unless other.is_a?(Number)
|
||||
operate(other, :>=)
|
||||
end
|
||||
|
||||
def lt(other)
|
||||
raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
|
||||
raise NoMethodError.new(nil, :lt) unless other.is_a?(Number)
|
||||
operate(other, :<)
|
||||
end
|
||||
|
||||
def lte(other)
|
||||
raise NoMethodError.new(nil, :gt) unless other.is_a?(Number)
|
||||
raise NoMethodError.new(nil, :lte) unless other.is_a?(Number)
|
||||
operate(other, :<=)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue