Closed
Description
Current AstAnalyser as flaw when we want to manipulate the SourceFile class before or after walking the AST, here is an example where we add new custom tracing;
import { AstAnalyser } from "@nodesecure/js-x-ray";
const scanner = new AstAnalyser();
scanner.analyse("const foo = 'bar';", {
initialize(sourceFile) {
sourceFile.tracer.trace("...");
},
finalize(sourceFile) {
// do something
}
});
Those callbacks should be triggered before and after walking the AST