Class: Minjs::ECMA262::ExpStrictEq
- Inherits:
-
Expression
- Object
- Base
- Expression
- Minjs::ECMA262::ExpStrictEq
- Includes:
- BinaryOperation
- Defined in:
- lib/minjs/ecma262/expression.rb
Overview
Class of the Strict Equals operator expression element.
Instance Attribute Summary
Attributes included from BinaryOperation
Attributes inherited from Base
Instance Method Summary collapse
-
#ecma262_typeof ⇒ Symbol
return results of ‘typeof’ operator.
-
#initialize(val, val2) ⇒ ExpStrictEq
constructor
A new instance of ExpStrictEq.
-
#priority ⇒ Fixnum
Expression priority.
-
#reduce(parent) ⇒ Object
reduce expression if available.
-
#sym ⇒ Object
symbol of expression.
Methods included from BinaryOperation
#==, #add_paren, #deep_dup, #remove_paren, #replace, #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, val2) ⇒ ExpStrictEq
Returns a new instance of ExpStrictEq.
1634 1635 1636 1637 |
# File 'lib/minjs/ecma262/expression.rb', line 1634 def initialize(val, val2) @val = val @val2 = val2 end |
Instance Method Details
#ecma262_typeof ⇒ Symbol
return results of ‘typeof’ operator.
1661 1662 1663 |
# File 'lib/minjs/ecma262/expression.rb', line 1661 def ecma262_typeof :boolean end |
#priority ⇒ Fixnum
Returns expression priority.
1645 1646 1647 |
# File 'lib/minjs/ecma262/expression.rb', line 1645 def priority PRIORITY_EQUALITY end |
#reduce(parent) ⇒ Object
reduce expression if available
1651 1652 1653 1654 1655 1656 |
# File 'lib/minjs/ecma262/expression.rb', line 1651 def reduce(parent) if @val.respond_to?(:ecma262_typeof) and @val2.respond_to?(:ecma262_typeof) and (t = @val.ecma262_typeof) == @val2.ecma262_typeof and !t.nil? parent.replace(self, ExpEq.new(@val, @val2)) end end |
#sym ⇒ Object
symbol of expression
1640 1641 1642 |
# File 'lib/minjs/ecma262/expression.rb', line 1640 def sym "===" end |