fix crash because for invalid type

This commit is contained in:
Tobias Koppers 2020-10-26 16:05:25 +01:00
parent b1a742225d
commit f2ed7ca3e3
3 changed files with 7 additions and 4 deletions

View File

@ -580,13 +580,15 @@ class RuntimeTemplate {
}) {
if (runtimeCondition === undefined) return "true";
if (typeof runtimeCondition === "boolean") return `${runtimeCondition}`;
/** @type {Set<string>} */
const positiveRuntimeIds = new Set();
forEachRuntime(runtimeCondition, runtime =>
positiveRuntimeIds.add(chunkGraph.getRuntimeId(runtime))
positiveRuntimeIds.add(`${chunkGraph.getRuntimeId(runtime)}`)
);
/** @type {Set<string>} */
const negativeRuntimeIds = new Set();
forEachRuntime(subtractRuntime(runtime, runtimeCondition), runtime =>
negativeRuntimeIds.add(chunkGraph.getRuntimeId(runtime))
negativeRuntimeIds.add(`${chunkGraph.getRuntimeId(runtime)}`)
);
runtimeRequirements.add(RuntimeGlobals.runtimeId);
return compileBooleanMatcher.fromLists(

View File

@ -1,5 +1,5 @@
module.exports = {
findBundle: function (i, options) {
return ["shared.js", "a.js", "b.js", "c.js"];
return ["shared.js", "a.js", "b.js", "c1.js", "c2.js"];
}
};

View File

@ -3,7 +3,8 @@ module.exports = {
entry: {
a: "./a",
b: "./b",
c: "./c"
c1: "./c",
c2: "./c"
},
target: "web",
output: {