class SyntaxTree::YARV::SetLocalWC0
### Summary
‘setlocal_WC_0` is a specialized version of the `setlocal` instruction. It sets the value of a local variable on the current frame to the value at the top of the stack as determined by the index given as its only argument.
### Usage
~~~ruby value = 5 ~~~
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5372 def initialize(index) @index = index end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5388 def ==(other) other.is_a?(SetLocalWC0) && other.index == index end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5404 def call(vm) canonical.call(vm) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5400 def canonical SetLocal.new(index, 0) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5384 def deconstruct_keys(_keys) { index: index } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5376 def disasm(fmt) fmt.instruction("setlocal_WC_0", [fmt.local(index, implicit: 0)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 5380 def to_a(iseq) [:setlocal_WC_0, iseq.local_table.offset(index)] end