Class: Minjs::ECMA262::This
- Defined in:
- lib/minjs/ecma262/literal.rb
Overview
Class of ECMA262 ‘this’ element
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#==(obj) ⇒ Object
compare object.
-
#deep_dup ⇒ Object
duplicate object.
-
#initialize ⇒ This
constructor
A new instance of This.
-
#left_hand_side_exp? ⇒ Boolean
True if expression is kind of LeftHandSideExpression.
-
#to_js(options = {}) ⇒ Object
Returns a ECMAScript string containg the representation of element.
-
#traverse(parent) {|parent, _self| ... } ⇒ Object
Traverses this children and itself with given block.
Methods inherited from Literal
#lt?, #priority, #side_effect?, #ws?
Methods inherited from Base
#add_remove_paren, #concat, #replace
Constructor Details
#initialize ⇒ This
Returns a new instance of This.
145 146 |
# File 'lib/minjs/ecma262/literal.rb', line 145 def initialize end |
Instance Method Details
#==(obj) ⇒ Object
compare object
162 163 164 |
# File 'lib/minjs/ecma262/literal.rb', line 162 def ==(obj) self.class == obj.class end |
#deep_dup ⇒ Object
duplicate object
150 151 152 |
# File 'lib/minjs/ecma262/literal.rb', line 150 def deep_dup self.class.new end |
#left_hand_side_exp? ⇒ Boolean
Returns true if expression is kind of LeftHandSideExpression.
173 174 175 |
# File 'lib/minjs/ecma262/literal.rb', line 173 def left_hand_side_exp? true end |
#to_js(options = {}) ⇒ Object
Returns a ECMAScript string containg the representation of element.
168 169 170 |
# File 'lib/minjs/ecma262/literal.rb', line 168 def to_js( = {}) "this" end |
#traverse(parent) {|parent, _self| ... } ⇒ Object
Traverses this children and itself with given block.
157 158 159 |
# File 'lib/minjs/ecma262/literal.rb', line 157 def traverse(parent, &block) yield parent, self end |