Class: Minjs::ECMA262::ExpLogicalAnd
- Inherits:
-
Expression
- Object
- Base
- Expression
- Minjs::ECMA262::ExpLogicalAnd
- Includes:
- BinaryOperation
- Defined in:
- lib/minjs/ecma262/expression.rb
Overview
Class of the Bitwise Logical And 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) ⇒ ExpLogicalAnd
constructor
A new instance of ExpLogicalAnd.
-
#priority ⇒ Fixnum
Expression priority.
-
#sym ⇒ Object
symbol of expression.
-
#to_ecma262_boolean ⇒ Boolean
Returns results of ToBoolean().
Methods included from BinaryOperation
#==, #add_paren, #deep_dup, #remove_paren, #replace, #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, val2) ⇒ ExpLogicalAnd
Returns a new instance of ExpLogicalAnd.
1791 1792 1793 1794 |
# File 'lib/minjs/ecma262/expression.rb', line 1791 def initialize(val, val2) @val = val @val2 = val2 end |
Instance Method Details
#ecma262_typeof ⇒ Symbol
return results of ‘typeof’ operator.
1827 1828 1829 1830 1831 1832 1833 1834 |
# File 'lib/minjs/ecma262/expression.rb', line 1827 def ecma262_typeof if @val.respond_to? :ecma262_typeof and @val2.respond_to? :ecma262_typeof if @val.ecma262_typeof == @val2.ecma262_typeof return @val.ecma262_typeof end end nil end |
#priority ⇒ Fixnum
Returns expression priority.
1802 1803 1804 |
# File 'lib/minjs/ecma262/expression.rb', line 1802 def priority PRIORITY_LOGICAL_AND end |
#sym ⇒ Object
symbol of expression
1797 1798 1799 |
# File 'lib/minjs/ecma262/expression.rb', line 1797 def sym "&&" end |
#to_ecma262_boolean ⇒ Boolean
Returns results of ToBoolean()
Returns true or false if trivial, otherwise nil.
1814 1815 1816 1817 1818 1819 1820 1821 1822 |
# File 'lib/minjs/ecma262/expression.rb', line 1814 def to_ecma262_boolean return nil if !(@val.respond_to? :to_ecma262_boolean) return nil if @val.to_ecma262_boolean == nil return false if @val.to_ecma262_boolean == false return nil if !(@val2.respond_to? :to_ecma262_boolean) return nil if @val2.to_ecma262_boolean == nil return false if @val2.to_ecma262_boolean == false true end |