Permalink
Browse files

fixing uninitialized instance variable warnings

  • Loading branch information...
1 parent bcde875 commit 28a4a1fa1e524c25f3c652944aff59b907272704 @tenderlove committed Mar 21, 2013
View
@@ -55,7 +55,7 @@ def on_#{name}(&block)
end
def run_#{name}(*args)
- return unless @_sass_callbacks
+ return unless defined?(@_sass_callbacks) && @_sass_callbacks
return unless @_sass_callbacks[#{name.inspect}]
@_sass_callbacks[#{name.inspect}].each {|c| c[*args]}
end
View
@@ -31,6 +31,7 @@ def initialize(template, options = {})
template = template.read
end
+ @checked_encoding = nil
@options = options.dup
# Backwards compatibility
@options[:old] = true if @options[:alternate] == false
View
@@ -252,6 +252,9 @@ def self.for_file(filename, options)
def initialize(template, options={})
@options = self.class.normalize_options(options)
@template = template
+ @filename = nil
+ @checked_encoding = nil
+ @line = nil
end
# Render the template to CSS.
View
@@ -27,6 +27,8 @@ class Environment
# @param parent [Environment] See \{#parent}
def initialize(parent = nil, options = nil)
@parent = parent
+ @caller = nil
+ @content = nil
@options = options || (parent && parent.options) || {}
end
@@ -62,7 +64,7 @@ def #{name}(name)
end
def _#{name}(name)
- (@#{name}s && @#{name}s[name]) || @parent && @parent._#{name}(name)
+ (defined?(@#{name}s) && @#{name}s && @#{name}s[name]) || @parent && @parent._#{name}(name)
end
protected :_#{name}
View
@@ -138,6 +138,7 @@ def initialize(str, line, offset, options)
@options = options
@interpolation_stack = []
@prev = nil
+ @tok = nil
end
# Moves the lexer forward one token.
@@ -29,6 +29,8 @@ def offset
def initialize(str, line, offset, options = {})
@options = options
@lexer = lexer_class.new(str, line, offset, options)
+ @stop_at = nil
+ @in_parens = nil
end
# Parses a SassScript expression within an interpolated segment (`#{}`).
View
@@ -28,6 +28,10 @@ def initialize(str, filename, importer, line = 1, offset = 1)
@line = line
@offset = offset
@strs = []
+ @throw_error = nil
+ @throw_err = nil
+ @use_property_exception = nil
+ @expected = nil
end
# Parses an SCSS document.
View
@@ -64,6 +64,8 @@ class Node
def initialize
@children = []
+ @filename = nil
+ @options = nil
end
# Sets the options hash for the node and all its children.
@@ -69,6 +69,7 @@ def initialize(rule, selector_source_range = nil)
@rule = Sass::Util.strip_string_array(merged)
@selector_source_range = selector_source_range
@tabs = 0
+ @parsed_rules = nil
try_to_parse_non_interpolated_rules
super()
end
@@ -4,6 +4,8 @@ class Sass::Tree::Visitors::CheckNesting < Sass::Tree::Visitors::Base
def initialize
@parents = []
+ @parent = nil
+ @current_mixin_def = nil
end
def visit(node)
@@ -16,6 +16,7 @@ def initialize(options, format)
@options = options
@format = format
@tabs = 0
+ @is_else = nil
# 2 spaces by default
@tab_chars = @options[:indent] || " "
end
@@ -14,6 +14,7 @@ def self.visit(root); super; end
def initialize
@parent_directives = []
@extends = Sass::Util::SubsetMap.new
+ @parent = nil
end
# If an exception is raised, this adds proper metadata to the backtrace.
@@ -13,7 +13,13 @@ def initialize(build_source_mapping = false)
@line = 1
@offset = 1
@result = ""
- @source_mapping = Sass::Source::Map.new if build_source_mapping
+ @lstrip = false
+ @in_directive = nil
+ if build_source_mapping
+ @source_mapping = Sass::Source::Map.new
+ else
+ @source_mapping = nil
+ end
end
# Runs the visitor on `node`.

0 comments on commit 28a4a1f

Please sign in to comment.