escodegen icon indicating copy to clipboard operation
escodegen copied to clipboard

Comments to describe object properties getting removed

Open bezoerb opened this issue 10 years ago • 1 comments

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'] }
    }
});

bezoerb avatar Mar 17 '14 16:03 bezoerb

I think this issue is solved, isn't it?

lucivpav avatar Oct 07 '20 11:10 lucivpav