class RubyRunJs::OPCODES::POSTFIX_MEMBER_DOT
Public Class Methods
new(post, incr, prop)
click to toggle source
# File lib/ruby_run_js/opcodes.rb, line 109 def initialize(post, incr, prop) @cb = incr ? 1 : -1 @ca = post ? -@cb : 0 @prop = prop end
Public Instance Methods
eval(ctx)
click to toggle source
# File lib/ruby_run_js/opcodes.rb, line 115 def eval(ctx) left = ctx.stack.pop() target = to_number(get_member_dot(left, @prop, ctx.builtin)) + @cb if left.js_type == :Object left.put(@prop, target) end ctx.stack.append(target + @ca) nil end