class SyntaxTree::YARV::GetGlobal
~~~
$$
~~~ruby
### Usage
`getglobal` pushes the value of a global variables onto the stack.
### Summary
def ==(other)
def ==(other) other.is_a?(GetGlobal) && other.name == name end
def call(vm)
def call(vm) # Evaluating the name of the global variable because there isn't a # reflection API for global variables. vm.push(eval(name.to_s, binding, __FILE__, __LINE__)) end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { name: name } end
def disasm(fmt)
def disasm(fmt) fmt.instruction("getglobal", [fmt.object(name)]) end
def initialize(name)
def initialize(name) @name = name end
def length
def length 2 end
def pushes
def pushes 1 end
def to_a(_iseq)
def to_a(_iseq) [:getglobal, name] end