Class: Minjs::ECMA262::ExpPostDec

Inherits:
Expression show all
Includes:
UnaryOperation
Defined in:
lib/minjs/ecma262/expression.rb

Overview

Class of the Postfix decrement operator expression element.

See Also:

Instance Attribute Summary

Attributes included from UnaryOperation

#val

Attributes inherited from Base

#parent

Instance Method Summary collapse

Methods included from UnaryOperation

#==, #add_paren, #deep_dup, #remove_paren, #replace, #side_effect?, #traverse

Methods inherited from Expression

#left_hand_side_exp?, #reduce, #side_effect?

Methods inherited from Base

#==, #add_remove_paren, #concat, #deep_dup, #replace, #traverse

Constructor Details

#initialize(val) ⇒ ExpPostDec

Returns a new instance of ExpPostDec.



823
824
825
# File 'lib/minjs/ecma262/expression.rb', line 823

def initialize(val)
  @val = val
end

Instance Method Details

#priorityFixnum

Returns expression priority.

Returns:

  • (Fixnum)

    expression priority



833
834
835
# File 'lib/minjs/ecma262/expression.rb', line 833

def priority
  PRIORITY_POSTFIX
end

#symObject

symbol of expression



828
829
830
# File 'lib/minjs/ecma262/expression.rb', line 828

def sym
  "--"
end

#to_js(options = {}) ⇒ Object

Returns a ECMAScript string containg the representation of element.

See Also:



839
840
841
# File 'lib/minjs/ecma262/expression.rb', line 839

def to_js(options = {})
  concat options, @val, sym
end