webpack 5.99.0 → 5.99.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1952,10 +1952,19 @@ class JavascriptParser extends Parser {
|
|
1952
1952
|
* @param {(Statement | ModuleDeclaration)[]} statements statements
|
1953
1953
|
*/
|
1954
1954
|
walkStatements(statements) {
|
1955
|
+
let onlyFunctionDeclaration = false;
|
1956
|
+
|
1955
1957
|
for (let index = 0, len = statements.length; index < len; index++) {
|
1956
1958
|
const statement = statements[index];
|
1959
|
+
|
1960
|
+
if (onlyFunctionDeclaration && statement.type !== "FunctionDeclaration")
|
1961
|
+
continue;
|
1962
|
+
|
1957
1963
|
this.walkStatement(statement);
|
1958
|
-
|
1964
|
+
|
1965
|
+
if (this.scope.terminated) {
|
1966
|
+
onlyFunctionDeclaration = true;
|
1967
|
+
}
|
1959
1968
|
}
|
1960
1969
|
}
|
1961
1970
|
|
@@ -2302,13 +2311,19 @@ class JavascriptParser extends Parser {
|
|
2302
2311
|
this.walkStatement(statement.block);
|
2303
2312
|
this.scope.inTry = false;
|
2304
2313
|
}
|
2314
|
+
|
2305
2315
|
if (this.scope.terminated === "throw") {
|
2306
2316
|
this.scope.terminated = undefined;
|
2307
|
-
} else if (this.scope.terminated === "return") {
|
2308
|
-
return;
|
2309
2317
|
}
|
2318
|
+
|
2319
|
+
const oldTerminate = this.scope.terminated;
|
2320
|
+
|
2321
|
+
this.scope.terminated = undefined;
|
2322
|
+
|
2310
2323
|
if (statement.handler) this.walkCatchClause(statement.handler);
|
2311
2324
|
if (statement.finalizer) this.walkStatement(statement.finalizer);
|
2325
|
+
|
2326
|
+
this.scope.terminated = oldTerminate;
|
2312
2327
|
}
|
2313
2328
|
|
2314
2329
|
/**
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "webpack",
|
3
|
-
"version": "5.99.
|
3
|
+
"version": "5.99.1",
|
4
4
|
"author": "Tobias Koppers @sokra",
|
5
5
|
"description": "Packs ECMAScript/CommonJs/AMD modules for the browser. Allows you to split your codebase into multiple bundles, which can be loaded on demand. Supports loaders to preprocess files, i.e. json, jsx, es7, css, less, ... and your custom stuff.",
|
6
6
|
"license": "MIT",
|