Class: RubyRunJs::OPCODES::POSTFIX_MEMBER_DOT
- Defined in:
- lib/ruby_run_js/opcodes.rb
Instance Method Summary collapse
- #eval(ctx) ⇒ Object
-
#initialize(post, incr, prop) ⇒ POSTFIX_MEMBER_DOT
constructor
A new instance of POSTFIX_MEMBER_DOT.
Methods inherited from OP_CODE
Methods included from RubyRunJs::Operation
#abstract_equality_op, #abstract_inequality_op, #abstract_relational_comparison, #add_op, #binary_operation, #bit_and_op, #bit_bshift_op, #bit_invert_uop, #bit_lshift_op, #bit_or_op, #bit_rshift_op, #bit_xor_op, #div_op, #float, #greater_eq_op, #greater_op, #in_op, #instanceof_op, #less_eq_op, #less_op, #logical_negation_uop, #minus_uop, #mod_op, #mul_op, #plus_uop, #strict_equality_op, #strict_inequality_op, #sub_op, #typeof_uop, #unary_operation, #void_op
Methods included from Helper
#check_object, #get_member, #get_member_dot, #is_accessor_descriptor, #is_callable, #is_data_descriptor, #is_generic_descriptor, #is_primitive, #make_error, #strict_equality
Methods included from ConversionHelper
#convert_to_js_type, #to_boolean, #to_int32, #to_integer, #to_number, #to_object, #to_primitive, #to_string, #to_uint16, #to_uint32
Constructor Details
#initialize(post, incr, prop) ⇒ POSTFIX_MEMBER_DOT
Returns a new instance of POSTFIX_MEMBER_DOT.
109 110 111 112 113 |
# 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 |
Instance Method Details
#eval(ctx) ⇒ Object
115 116 117 118 119 120 121 122 123 124 125 |
# 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 |