class RubyRunJs::OPCODES::JUMP_IF_EQ

Public Instance Methods

eval(ctx) click to toggle source

this one is used in switch statement - compares last 2 values using === operator and jumps popping both if true else pops last.

# File lib/ruby_run_js/opcodes.rb, line 219
def eval(ctx)
  cmp = ctx.stack.pop()
  if strict_equality_op(ctx.stack[-1], cmp)
    ctx.stack.pop()
    return @label
  end
end