Class: Minjs::ECMA262::ExpPostInc

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

Overview

Class of the Postfix increment 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) ⇒ ExpPostInc

Returns a new instance of ExpPostInc.



797
798
799
# File 'lib/minjs/ecma262/expression.rb', line 797

def initialize(val)
  @val = val
end

Instance Method Details

#priorityFixnum

Returns expression priority.

Returns:

  • (Fixnum)

    expression priority



807
808
809
# File 'lib/minjs/ecma262/expression.rb', line 807

def priority
  PRIORITY_POSTFIX
end

#symObject

symbol of expression



802
803
804
# File 'lib/minjs/ecma262/expression.rb', line 802

def sym
  "++"
end

#to_js(options = {}) ⇒ Object

Returns a ECMAScript string containg the representation of element.

See Also:



813
814
815
# File 'lib/minjs/ecma262/expression.rb', line 813

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