Class: Minjs::ECMA262::ECMA262Array
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from Literal
#lt?, #priority, #to_exp?, #ws?
Methods inherited from Base
#concat, #replace, #to_s
Constructor Details
Returns a new instance of ECMA262Array.
441
442
443
|
# File 'lib/minjs/ecma262/lit.rb', line 441
def initialize(val)
@val = val end
|
Instance Attribute Details
#val ⇒ Object
Returns the value of attribute val.
439
440
441
|
# File 'lib/minjs/ecma262/lit.rb', line 439
def val
@val
end
|
Instance Method Details
#==(obj) ⇒ Object
456
457
458
|
# File 'lib/minjs/ecma262/lit.rb', line 456
def ==(obj)
self.class == obj.class and @val == obj.val
end
|
#deep_dup ⇒ Object
445
446
447
|
# File 'lib/minjs/ecma262/lit.rb', line 445
def deep_dup
self.class.new(@val.collect{|x| x ? x.deep_dup : nil})
end
|
#to_ecma262_boolean ⇒ Object
463
464
465
|
# File 'lib/minjs/ecma262/lit.rb', line 463
def to_ecma262_boolean
true
end
|
#to_js(options = {}) ⇒ Object
460
461
462
|
# File 'lib/minjs/ecma262/lit.rb', line 460
def to_js(options = {})
"[" + @val.collect{|x| x.to_s}.join(",") + "]"
end
|
#traverse(parent) {|_self, parent| ... } ⇒ Object
449
450
451
452
453
454
|
# File 'lib/minjs/ecma262/lit.rb', line 449
def traverse(parent, &block)
yield self, parent
@val.each do |k|
k.traverse(parent, &block) if k
end
end
|