class RubyRunJs::OPCODES::UNARY_OP

Public Class Methods

new(operator) click to toggle source
# File lib/ruby_run_js/opcodes.rb, line 36
def initialize(operator)
  @operator = operator
end

Public Instance Methods

eval(ctx) click to toggle source
# File lib/ruby_run_js/opcodes.rb, line 40
def eval(ctx)
  val = ctx.stack.pop()
  ctx.stack.append(unary_operation(@operator, val))
  nil
end