Class: Minjs::ECMA262::StThrow
- Defined in:
- lib/minjs/ecma262/statement.rb
Overview
Base class of ECMA262 ThrowStatement element.
Instance Attribute Summary collapse
-
#exp ⇒ Object
readonly
Returns the value of attribute exp.
Attributes inherited from Base
Instance Method Summary collapse
-
#==(obj) ⇒ Object
compare object.
-
#deep_dup ⇒ Object
duplicate object.
-
#initialize(exp) ⇒ StThrow
constructor
A new instance of StThrow.
-
#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 Statement
#empty?, #priority, #to_exp?, #to_return?
Methods inherited from Base
#add_remove_paren, #concat, #replace
Constructor Details
#initialize(exp) ⇒ StThrow
Returns a new instance of StThrow.
1355 1356 1357 |
# File 'lib/minjs/ecma262/statement.rb', line 1355 def initialize(exp) @exp = exp end |
Instance Attribute Details
#exp ⇒ Object (readonly)
Returns the value of attribute exp.
1353 1354 1355 |
# File 'lib/minjs/ecma262/statement.rb', line 1353 def exp @exp end |
Instance Method Details
#==(obj) ⇒ Object
compare object
1372 1373 1374 1375 |
# File 'lib/minjs/ecma262/statement.rb', line 1372 def ==(obj) self.class == obj.class and @exp == obj.exp end |
#deep_dup ⇒ Object
duplicate object
1361 1362 1363 |
# File 'lib/minjs/ecma262/statement.rb', line 1361 def deep_dup self.class.new(@exp.deep_dup) end |
#to_js(options = {}) ⇒ Object
Returns a ECMAScript string containg the representation of element.
1379 1380 1381 |
# File 'lib/minjs/ecma262/statement.rb', line 1379 def to_js( = {}) concat , :throw, @exp, ";" end |
#traverse(parent) {|parent, _self| ... } ⇒ Object
Traverses this children and itself with given block.
1366 1367 1368 1369 |
# File 'lib/minjs/ecma262/statement.rb', line 1366 def traverse(parent, &block) @exp.traverse(self, &block) yield parent, self end |