escodegen
escodegen copied to clipboard
Comments to describe object properties getting removed
Code:
grunt.initConfig({
// Unit tests.
simplemocha: {
all: { src: ['test/**/*-test.js'] }
}
});
Handling:
var ast = esprima.parse(code, { comment: true, range: true, tokens: true });
console.log(ast.comments.length);
ast = escodegen.attachComments(ast, ast.comments, ast.tokens);
console.log(ast);
console.log(escodegen.generate(ast, { comment: true });
Result:
grunt.initConfig({
simplemocha: {
all: { src: ['test/**/*-test.js'] }
}
});
I think this issue is solved, isn't it?