parse export & import statements correctly (#5550)

fixes #5548
This commit is contained in:
Alex Lam S.L
2022-07-07 21:04:56 +01:00
committed by GitHub
parent 80787ff7ef
commit b2bc2e1173
5 changed files with 93 additions and 19 deletions

View File

@@ -69,7 +69,7 @@ function make_code(ast, options) {
function parse_test(file) {
var script = fs.readFileSync(file, "utf8");
try {
var ast = U.parse(script, { filename: file });
var ast = U.parse(script, { filename: file, module: "" });
} catch (e) {
console.error("Caught error while parsing tests in " + file);
console.error(e);