add onComment shim to babel.parse API

This commit is contained in:
Sebastian McKenzie 2015-07-21 17:50:49 +01:00
parent 7fa684b120
commit f6e7b7716b

View File

@ -97,5 +97,9 @@ export function parse(code, opts = {}) {
opts.onToken.push(...ast.tokens);
}
if (opts.onComment) {
opts.onComment.push(...ast.comments);
}
return ast.program;
}