mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Move Funcall::EvaluationContext to Functions.
This commit is contained in:
parent
13a27a1856
commit
6161e5fd5c
2 changed files with 11 additions and 12 deletions
|
@ -2,17 +2,6 @@ require File.join(File.dirname(__FILE__), 'functions')
|
|||
module Sass
|
||||
module Script
|
||||
class Funcall # :nodoc:
|
||||
class EvaluationContext # :nodoc:
|
||||
|
||||
include Sass::Script::Functions
|
||||
|
||||
attr_reader :options
|
||||
|
||||
def initialize(options)
|
||||
@options = options
|
||||
end
|
||||
end
|
||||
|
||||
attr_reader :name, :args
|
||||
|
||||
def initialize(name, args)
|
||||
|
@ -30,7 +19,7 @@ module Sass
|
|||
return Script::String.new("#{name}(#{args.map {|a| a.perform(environment)}.join(', ')})")
|
||||
end
|
||||
|
||||
return EvaluationContext.new(environment.options).send(name, *args)
|
||||
return Functions::EvaluationContext.new(environment.options).send(name, *args)
|
||||
rescue ArgumentError => e
|
||||
raise e unless e.backtrace.first =~ /:in `(#{name}|perform)'$/
|
||||
raise Sass::SyntaxError.new("#{e.message} for `#{name}'")
|
||||
|
|
|
@ -44,6 +44,16 @@ module Sass::Script
|
|||
#
|
||||
# Example: <tt>abs(-10px) => 10px</tt>
|
||||
module Functions
|
||||
class EvaluationContext # :nodoc:
|
||||
include Sass::Script::Functions
|
||||
|
||||
attr_reader :options
|
||||
|
||||
def initialize(options)
|
||||
@options = options
|
||||
end
|
||||
end
|
||||
|
||||
instance_methods.each { |m| undef_method m unless m.to_s =~ /^__/ }
|
||||
extend self
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue