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 b1f08dd
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/babel-traverse/src/scope/binding.ts
Expand Up @@ -44,7 +44,21 @@ export default class Binding {
this.path = path;
this.kind = kind;

if ((kind === "var" || kind === "hoisted") && isDeclaredInLoop(path)) {
if (
(kind === "var" || kind === "hoisted") &&
// https://github.com/rollup/rollup/issues/4654
// 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
isDeclaredInLoop(
path ||
(() => {
throw new Error("Internal Babel error: unreachable ");
})(),
)
) {
this.reassign(path);
}

Expand Down

0 comments on commit b1f08dd

Please sign in to comment.