feat: refactoring project
This commit is contained in:
22
node_modules/webpack/lib/ConstPlugin.js
generated
vendored
22
node_modules/webpack/lib/ConstPlugin.js
generated
vendored
@@ -207,21 +207,13 @@ class ConstPlugin {
|
||||
// NOTE: When code runs in strict mode, `var` declarations
|
||||
// are hoisted but `function` declarations don't.
|
||||
//
|
||||
let declarations;
|
||||
if (parser.scope.isStrict) {
|
||||
// If the code runs in strict mode, variable declarations
|
||||
// using `var` must be hoisted.
|
||||
declarations = getHoistedDeclarations(branchToRemove, false);
|
||||
} else {
|
||||
// Otherwise, collect all hoisted declaration.
|
||||
declarations = getHoistedDeclarations(branchToRemove, true);
|
||||
}
|
||||
let replacement;
|
||||
if (declarations.length > 0) {
|
||||
replacement = `{ var ${declarations.join(", ")}; }`;
|
||||
} else {
|
||||
replacement = "{}";
|
||||
}
|
||||
const declarations = parser.scope.isStrict
|
||||
? getHoistedDeclarations(branchToRemove, false)
|
||||
: getHoistedDeclarations(branchToRemove, true);
|
||||
const replacement =
|
||||
declarations.length > 0
|
||||
? `{ var ${declarations.join(", ")}; }`
|
||||
: "{}";
|
||||
const dep = new ConstDependency(
|
||||
replacement,
|
||||
/** @type {Range} */ (branchToRemove.range)
|
||||
|
||||
Reference in New Issue
Block a user