Skip to content

Commit

Permalink
Add workaround for self-induced TLA detection
Browse files Browse the repository at this point in the history
  • Loading branch information
perbergland committed Oct 22, 2024
1 parent 8148eb4 commit 60f23e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/import-export-visitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -390,12 +390,19 @@ class ImportExportVisitor extends Visitor {
visitAwaitExpression(path) {
if (!this.hasTopLevelAwait) {
const parent = path.getParentNode(1);

const node = path.getNode();
if (
parent.type === 'ExpressionStatement' &&
path.getParentNode(2).type === 'Program'
) {
this.hasTopLevelAwait = true;
} else if (node.argument.type === "CallExpression" &&
node.argument.callee.type === "Identifier" &&
node.argument.callee.name === "__reifyWaitForDeps__"
) {
// Do not treat the emitted "await __reifyWaitForDeps__()" as a TLA trigger
// This happens e.g. for the package refapp:meteor-typescript which subclasses
// BabelCompiler
} else {
this.hasTopLevelAwait = isTopLevelAwait(path.stack);
}
Expand Down

0 comments on commit 60f23e7

Please sign in to comment.