fix(packages): use ES modules for primary build (#11120)

This commit is contained in:
Miško Hevery
2016-08-30 18:07:40 -07:00
committed by Victor Berchet
parent 8cb1046ce9
commit 979657989b
249 changed files with 1929 additions and 1463 deletions

View File

@ -20,8 +20,13 @@ class ASTValidator extends RecursiveAstVisitor {
validate(ast: AST, cb: () => void): void {
if (!inSpan(ast.span, this.parentSpan)) {
throw Error(
`Invalid AST span [expected (${ast.span.start}, ${ast.span.end}) to be in (${this.parentSpan.start}, ${this.parentSpan.end}) for ${unparse(ast)}`);
if (this.parentSpan) {
let parentSpan = this.parentSpan as ParseSpan;
throw Error(
`Invalid AST span [expected (${ast.span.start}, ${ast.span.end}) to be in (${parentSpan.start}, ${parentSpan.end}) for ${unparse(ast)}`);
} else {
throw Error(`Invalid root AST span for ${unparse(ast)}`);
}
}
const oldParent = this.parentSpan;
this.parentSpan = ast.span;