Skip to content

Commit

Permalink
use latest JS version in acorn parser
Browse files Browse the repository at this point in the history
  • Loading branch information
cscheid committed Jan 15, 2025
1 parent 7d809d7 commit fb38eb5
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/execute/ojs/extract-resources.ts
Original file line number Diff line number Diff line change
Expand Up @@ -446,11 +446,17 @@ quarto will only generate javascript files in ${
}

let fixedSource = jsSource;

const ast = parseES6(jsSource, {
ecmaVersion: "2020",
sourceType: "module",
});
let ast: any = undefined;
try {
ast = parseES6(jsSource, {
ecmaVersion: "latest",
sourceType: "module",
});
} catch (e) {
console.error(jsSource);
console.error("Error parsing compiled typescript file.");
throw e;
}
const recursionList: string[] = [];
// deno-lint-ignore no-explicit-any
const patchDeclaration = (node: any) => {
Expand Down

0 comments on commit fb38eb5

Please sign in to comment.