lib/minjs/ecma262/base.rb in minjs-0.1.2 vs lib/minjs/ecma262/base.rb in minjs-0.1.3

- old
+ new

@@ -41,10 +41,14 @@ j.push(js) prev = js end j.join("") end + + def replace(from, to) + puts "warning: #{self.class}: replace not implement" + end end class Prog < Base attr_reader :source_elements attr_reader :context @@ -106,9 +110,15 @@ end end def remove(st) @source_elements.delete(st) + end + + def remove_empty_statement + @source_elements.reject!{|x| + x.class == StEmpty + } end def each(&block) @source_elements.each(&block) end