Class: Minjs::ECMA262::ExpPositive
- Inherits:
-
Expression
- Object
- Base
- Expression
- Minjs::ECMA262::ExpPositive
- Includes:
- UnaryOperation
- Defined in:
- lib/minjs/ecma262/expression.rb
Overview
Class of the Positive operator expression element.
Instance Attribute Summary
Attributes included from UnaryOperation
Attributes inherited from Base
Instance Method Summary collapse
-
#ecma262_typeof ⇒ Symbol
return results of ‘typeof’ operator.
-
#initialize(val) ⇒ ExpPositive
constructor
A new instance of ExpPositive.
-
#priority ⇒ Fixnum
Expression priority.
-
#reduce(parent) ⇒ Object
reduce expression if available.
-
#sym ⇒ Object
symbol of expression.
Methods included from UnaryOperation
#==, #add_paren, #deep_dup, #remove_paren, #replace, #side_effect?, #to_js, #traverse
Methods inherited from Expression
#left_hand_side_exp?, #side_effect?
Methods inherited from Base
#==, #add_remove_paren, #concat, #deep_dup, #replace, #to_js, #traverse
Constructor Details
#initialize(val) ⇒ ExpPositive
Returns a new instance of ExpPositive.
973 974 975 |
# File 'lib/minjs/ecma262/expression.rb', line 973 def initialize(val) @val = val end |
Instance Method Details
#ecma262_typeof ⇒ Symbol
return results of ‘typeof’ operator.
998 999 1000 |
# File 'lib/minjs/ecma262/expression.rb', line 998 def ecma262_typeof :number end |
#priority ⇒ Fixnum
Returns expression priority.
983 984 985 |
# File 'lib/minjs/ecma262/expression.rb', line 983 def priority PRIORITY_UNARY end |
#reduce(parent) ⇒ Object
reduce expression if available
989 990 991 992 993 |
# File 'lib/minjs/ecma262/expression.rb', line 989 def reduce(parent) if @val.kind_of? ECMA262Numeric parent.replace(self, @val) end end |
#sym ⇒ Object
symbol of expression
978 979 980 |
# File 'lib/minjs/ecma262/expression.rb', line 978 def sym "+" end |