Class: Minjs::ECMA262::ExpPreDec

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

Overview

Class of the Prefix 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?, #to_js, #traverse

Methods inherited from Expression

#left_hand_side_exp?, #reduce, #side_effect?

Methods inherited from Base

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

Constructor Details

#initialize(val) ⇒ ExpPreDec

Returns a new instance of ExpPreDec.



946
947
948
# File 'lib/minjs/ecma262/expression.rb', line 946

def initialize(val)
  @val = val
end

Instance Method Details

#ecma262_typeofSymbol

return results of ‘typeof’ operator.

Returns:

  • (Symbol)

    :number



963
964
965
# File 'lib/minjs/ecma262/expression.rb', line 963

def ecma262_typeof
  :number
end

#priorityFixnum

Returns expression priority.

Returns:

  • (Fixnum)

    expression priority



956
957
958
# File 'lib/minjs/ecma262/expression.rb', line 956

def priority
  PRIORITY_UNARY
end

#symObject

symbol of expression



951
952
953
# File 'lib/minjs/ecma262/expression.rb', line 951

def sym
  "--"
end