updated npm modules
This commit is contained in:
26
node_modules/webpack/lib/Parser.js
generated
vendored
26
node_modules/webpack/lib/Parser.js
generated
vendored
@@ -1593,7 +1593,14 @@ class Parser extends Tapable {
|
||||
walkFunctionExpression(expression) {
|
||||
const wasTopLevel = this.scope.topLevelScope;
|
||||
this.scope.topLevelScope = false;
|
||||
this.inScope(expression.params, () => {
|
||||
const scopeParams = expression.params;
|
||||
|
||||
// Add function name in scope for recursive calls
|
||||
if (expression.id) {
|
||||
scopeParams.push(expression.id.name);
|
||||
}
|
||||
|
||||
this.inScope(scopeParams, () => {
|
||||
for (const param of expression.params) {
|
||||
this.walkPattern(param);
|
||||
}
|
||||
@@ -1777,7 +1784,14 @@ class Parser extends Tapable {
|
||||
const args = options.map(renameArgOrThis);
|
||||
const wasTopLevel = this.scope.topLevelScope;
|
||||
this.scope.topLevelScope = false;
|
||||
this.inScope(params.filter((identifier, idx) => !args[idx]), () => {
|
||||
const scopeParams = params.filter((identifier, idx) => !args[idx]);
|
||||
|
||||
// Add function name in scope for recursive calls
|
||||
if (functionExpression.id) {
|
||||
scopeParams.push(functionExpression.id.name);
|
||||
}
|
||||
|
||||
this.inScope(scopeParams, () => {
|
||||
if (renameThis) {
|
||||
this.scope.renames.set("this", renameThis);
|
||||
}
|
||||
@@ -1940,6 +1954,9 @@ class Parser extends Tapable {
|
||||
case "RestElement":
|
||||
this.enterRestElement(pattern, onIdent);
|
||||
break;
|
||||
case "Property":
|
||||
this.enterPattern(pattern.value, onIdent);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1954,7 +1971,7 @@ class Parser extends Tapable {
|
||||
propIndex++
|
||||
) {
|
||||
const prop = pattern.properties[propIndex];
|
||||
this.enterPattern(prop.value, onIdent);
|
||||
this.enterPattern(prop, onIdent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2224,6 +2241,8 @@ class Parser extends Tapable {
|
||||
|
||||
if (type === "auto") {
|
||||
parserOptions.sourceType = "module";
|
||||
} else if (parserOptions.sourceType === "script") {
|
||||
parserOptions.allowReturnOutsideFunction = true;
|
||||
}
|
||||
|
||||
let ast;
|
||||
@@ -2238,6 +2257,7 @@ class Parser extends Tapable {
|
||||
|
||||
if (threw && type === "auto") {
|
||||
parserOptions.sourceType = "script";
|
||||
parserOptions.allowReturnOutsideFunction = true;
|
||||
if (Array.isArray(parserOptions.onComment)) {
|
||||
parserOptions.onComment.length = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user