Class: Minjs::ECMA262::SingleLineComment

Inherits:
Literal
  • Object
show all
Defined in:
lib/minjs/ecma262/lit.rb

Instance Method Summary collapse

Methods inherited from Literal

#lt?, #priority, #to_exp?

Methods inherited from Base

#add_remove_paren, #concat, #deep_dup, #replace, #to_s

Constructor Details

#initialize(comment) ⇒ SingleLineComment

Returns a new instance of SingleLineComment.



801
802
803
# File 'lib/minjs/ecma262/lit.rb', line 801

def initialize(comment)
  @comment = comment
end

Instance Method Details

#==(obj) ⇒ Object



808
809
810
811
# File 'lib/minjs/ecma262/lit.rb', line 808

def ==(obj)
  self.class == obj.class and
    @comment == obj.comment
end

#to_js(options) ⇒ Object



813
814
815
# File 'lib/minjs/ecma262/lit.rb', line 813

def to_js(options)
  "//#{@comment}"
end

#traverse(parent, &block) ⇒ Object



805
806
# File 'lib/minjs/ecma262/lit.rb', line 805

def traverse(parent, &block)
end

#ws?Boolean

Returns:



817
818
819
# File 'lib/minjs/ecma262/lit.rb', line 817

def ws?
  true
end