Skip to content

Commit

Permalink
Fix the duplicate export initialization (#14272)
Browse files Browse the repository at this point in the history
  • Loading branch information
JasinYip committed Feb 16, 2022
1 parent 5c2fcad commit 9560c92
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/babel-helper-module-transforms/src/index.ts
Expand Up @@ -460,11 +460,8 @@ function buildExportInitializationStatements(
// We generate init statements (`exports.a = exports.b = ... = void 0`)
// for every 100 exported names to avoid deeply-nested AST structures.
const chunkSize = 100;
for (
let i = 0, uninitializedExportNames = [];
i < initStatements.length;
i += chunkSize
) {
for (let i = 0; i < initStatements.length; i += chunkSize) {
let uninitializedExportNames = [];
for (let j = 0; j < chunkSize && i + j < initStatements.length; j++) {
const [exportName, initStatement] = initStatements[i + j];
if (initStatement !== null) {
Expand Down

0 comments on commit 9560c92

Please sign in to comment.