Skip to content

Commit

Permalink
Fix CI error
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Oct 7, 2022
1 parent 0a21a22 commit 146c2a5
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/babel-traverse/src/scope/binding.ts
Expand Up @@ -44,7 +44,22 @@ export default class Binding {
this.path = path;
this.kind = kind;

if ((kind === "var" || kind === "hoisted") && isDeclaredInLoop(path)) {
if (
(kind === "var" || kind === "hoisted") &&
// For some reason, rollup removes the path argument from this
// call. Add an unreachable IIFE (that rollup doesn't know is
// unreachable) with side effects, to prevent it from messing
// up with arguments.
// You can reproduce this with
// BABEL_8_BREAKING=true make prepublish-build
// TODO(@nicolo-ribaudo): Investigate.
isDeclaredInLoop(
path ||
(() => {
throw new Error("Internal Babel error: unreachable ");
})(),
)
) {
this.reassign(path);
}

Expand Down

0 comments on commit 146c2a5

Please sign in to comment.