mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
[Sass] Don't pass @options to Environment#initialize.
This commit is contained in:
parent
78f6be2fb8
commit
b30e4d62bd
4 changed files with 6 additions and 5 deletions
|
@ -99,7 +99,7 @@ module Sass
|
|||
|
||||
# Processes the template and returns the result as a string.
|
||||
def render
|
||||
to_tree.perform(Environment.new(nil, @options)).to_s
|
||||
to_tree.perform(Environment.new).to_s
|
||||
end
|
||||
|
||||
alias_method :to_css, :render
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
module Sass
|
||||
class Environment
|
||||
attr_reader :parent
|
||||
attr_writer :options
|
||||
|
||||
def initialize(parent = nil, options = nil)
|
||||
def initialize(parent = nil)
|
||||
@vars = {}
|
||||
@mixins = {}
|
||||
@parent = parent
|
||||
@options = options
|
||||
|
||||
set_var("important", Script::String.new("!important")) unless @parent
|
||||
end
|
||||
|
|
|
@ -69,9 +69,9 @@ module Sass
|
|||
File.delete(css) if File.exists?(css)
|
||||
|
||||
filename = template_filename(name, template_location)
|
||||
options = engine_options(:css_filename => css, :filename => filename)
|
||||
result = begin
|
||||
Engine.tree_for(filename, options).perform(Environment.new(nil, options)).to_s
|
||||
Engine.tree_for(filename, engine_options(:css_filename => css, :filename => filename)).
|
||||
perform(Environment.new).to_s
|
||||
rescue Exception => e
|
||||
exception_string(e)
|
||||
end
|
||||
|
|
|
@ -51,6 +51,7 @@ module Sass
|
|||
end
|
||||
|
||||
def perform(environment)
|
||||
environment.options = @options if self.class == Tree::Node
|
||||
_perform(environment)
|
||||
rescue Sass::SyntaxError => e; e.add_metadata(filename, line)
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue