Skip to content

Commit

Permalink
fix #6688
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Mar 6, 2018
1 parent c54df36 commit 800e7f9
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/optimize/ConcatenatedModule.js
Expand Up @@ -173,10 +173,10 @@ const getSymbolsFromScope = (s, untilScope) => {
const allUsedNames = new Set();
let scope = s;
while (scope) {
if (untilScope === scope) break;
for (const variable of scope.variables) {
allUsedNames.add(variable.name);
}
if (untilScope === scope) break;
scope = scope.upper;
}
return allUsedNames;
Expand Down
5 changes: 5 additions & 0 deletions test/configCases/scope-hoisting/class-naming/index.js
@@ -0,0 +1,5 @@
import { Hello as t } from "./module2";

it("should rename classes correctly", () => {
new t();
});
1 change: 1 addition & 0 deletions test/configCases/scope-hoisting/class-naming/module.js
@@ -0,0 +1 @@
export class Hello {}
3 changes: 3 additions & 0 deletions test/configCases/scope-hoisting/class-naming/module2.js
@@ -0,0 +1,3 @@
import * as MODULE from "./module";
let Hello = class Hello extends MODULE.Hello {}
export { Hello }
@@ -0,0 +1,5 @@
module.exports = {
optimization: {
concatenateModules: true
}
};

0 comments on commit 800e7f9

Please sign in to comment.