Method: Opal::Nodes::ClassVariableNode#compile

Defined in:
lib/opal/nodes/variables.rb

#compileObject



196
197
198
199
200
201
202
203
204
205
206
207
# 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