add onComment shim to babel.parse API
This commit is contained in:
parent
7fa684b120
commit
f6e7b7716b
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user