class Opal::Nodes::ClassVariableNode

Public Instance Methods

compile() click to toggle source
# File lib/opal/nodes/variables.rb, line 196
def compile
  helper :class_variable_get

  tolerant = false
  # We should be tolerant of expressions like: def x; @@notexist; 0; end
  # (NB: Shouldn't we actually optimize them out?)
  tolerant = true if stmt?
  # We should be tolerant of expressions like: @@notexist ||= 6
  # (those are handled with logical_operator_assignment)

  push "$class_variable_get(#{class_variable_owner}, '#{name}', #{tolerant.inspect})"
end