millermedeiros / rocambole

Recursively walk and transform EcmaScript AST
171 stars 12 forks source link

there is a bug related with comments and the way WhiteSpace tokens are retrieved #3

Closed millermedeiros closed 11 years ago

millermedeiros commented 11 years ago

this generates the wrong tokens:

var ast = walker.parse("\n/* foo */\n/* bar */\nfunction foo(){\n  var bar = 'baz';\n\n  //foo\n  //bar\n\n  var lorem = 'ipsum';\n  return bar + lorem;\n}");

the token /* bar */ is considered a WhiteSpace instead of a BlockComment.