class Sass::Tree::VariableNode

@see Sass::Tree
A dynamic node representing a variable definition.

def _perform(environment)

Parameters:
  • environment (Sass::Environment) -- The lexical environment containing
def _perform(environment)
  if @guarded && environment.var(@name).nil?
    environment.set_var(@name, @expr.perform(environment))
  elsif !@guarded
    environment.set_var(@name, @expr.perform(environment))
  end
  []
end

def initialize(name, expr, guarded)

Parameters:
  • guarded (Boolean) -- Whether this is a guarded variable assignment (`||=`)
  • expr (Script::Node) -- The parse tree for the initial variable value
  • name (String) -- The name of the variable
def initialize(name, expr, guarded)
  @name = name
  @expr = expr
  @guarded = guarded
  super()
end