Skip to content

Commit

Permalink
skip connections copied to concatenated module
Browse files Browse the repository at this point in the history
fixes #11617
  • Loading branch information
sokra committed Oct 9, 2020
1 parent 57b493f commit 4709719
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/optimize/ConcatenatedModule.js
Expand Up @@ -795,6 +795,7 @@ class ConcatenatedModule extends Module {
return false;
return (
connection &&
connection.resolvedOriginModule === module &&
connection.module &&
connection.isTargetActive(runtime)
);
Expand Down
6 changes: 6 additions & 0 deletions test/cases/scope-hoisting/import-order-11617/a.js
@@ -0,0 +1,6 @@
import "./b";
import "./c";

import { track } from "./tracker";

track("a");
5 changes: 5 additions & 0 deletions test/cases/scope-hoisting/import-order-11617/b.js
@@ -0,0 +1,5 @@
import "./x";

import { track } from "./tracker";

track("b");
3 changes: 3 additions & 0 deletions test/cases/scope-hoisting/import-order-11617/c.js
@@ -0,0 +1,3 @@
var track = require("./tracker").track;

track("c");
8 changes: 8 additions & 0 deletions test/cases/scope-hoisting/import-order-11617/index.js
@@ -0,0 +1,8 @@
import "./x";
import "./y";
import "./a";
import { log } from "./tracker";

it("should evaluate import in the correct order", function () {
expect(log).toEqual(["b", "c", "a"]);
});
5 changes: 5 additions & 0 deletions test/cases/scope-hoisting/import-order-11617/tracker.js
@@ -0,0 +1,5 @@
export var log = [];

export function track(name) {
log.push(name);
}
1 change: 1 addition & 0 deletions test/cases/scope-hoisting/import-order-11617/x.js
@@ -0,0 +1 @@
console.log.bind(console);
1 change: 1 addition & 0 deletions test/cases/scope-hoisting/import-order-11617/y.js
@@ -0,0 +1 @@
console.log.bind(console);

0 comments on commit 4709719

Please sign in to comment.