Skip to content

Commit

Permalink
fix ExportsInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
vankop committed Apr 6, 2022
1 parent cb639b3 commit 649fd81
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/ExportsInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class ExportsInfo {
if (info.exportsInfo && name.length > 1) {
return info.exportsInfo.isExportProvided(name.slice(1));
}
return info.provided;
return info.provided ? name.length === 1 || undefined : info.provided;
}
const info = this.getReadOnlyExportInfo(name);
return info.provided;
Expand Down
3 changes: 3 additions & 0 deletions test/cases/parsing/harmony-export-import-specifier/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { b1, usedB1, usedB2, usedB3, usedB4 } from "./b.js";
import { usedE1, usedE2 } from "./e.js";
import { h } from "./h.js";
import * as m from "./m";
import {object as obj} from "./m";
import * as o from "./o";
import * as p from "./p";
import * as q from "./q";
Expand Down Expand Up @@ -45,6 +46,8 @@ it("complex case should work correctly", () => {
it("should handle 'm in n' case", () => {
const obj = { aaa: "aaa" in m };
expect(obj.aaa).toBe(true);
expect("not_here" in m.object).toBe(false);
expect("not_here" in obj).toBe(false);
expect("aaa" in o).toBe(true);
expect("aaa" in p).toBe(false);
expect("ccc" in m).toBe(false);
Expand Down
1 change: 1 addition & 0 deletions test/cases/parsing/harmony-export-import-specifier/m.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export const aaa = 1;
export const bbb = 2;
export const object = {};
export * as ddd from "./n";
export const usedA = __webpack_exports_info__.aaa.used;
export const canMangleA = __webpack_exports_info__.ccc.canMangle;
Expand Down

0 comments on commit 649fd81

Please sign in to comment.