webpack 5.99.2 → 5.99.4

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.
@@ -2197,13 +2197,22 @@ class JavascriptParser extends Parser {
2197
2197
  walkIfStatement(statement) {
2198
2198
  const result = this.hooks.statementIf.call(statement);
2199
2199
  if (result === undefined) {
2200
- this.inExecutedPath(false, () => {
2201
- this.walkExpression(statement.test);
2202
- this.walkNestedStatement(statement.consequent);
2203
- if (statement.alternate) {
2204
- this.walkNestedStatement(statement.alternate);
2205
- }
2206
- });
2200
+ this.walkExpression(statement.test);
2201
+ this.walkNestedStatement(statement.consequent);
2202
+
2203
+ const consequentTerminated = this.scope.terminated;
2204
+ this.scope.terminated = undefined;
2205
+
2206
+ if (statement.alternate) {
2207
+ this.walkNestedStatement(statement.alternate);
2208
+ }
2209
+
2210
+ const alternateTerminated = this.scope.terminated;
2211
+
2212
+ this.scope.terminated =
2213
+ consequentTerminated && alternateTerminated
2214
+ ? this.scope.terminated
2215
+ : undefined;
2207
2216
  } else {
2208
2217
  this.inExecutedPath(true, () => {
2209
2218
  if (result) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webpack",
3
- "version": "5.99.2",
3
+ "version": "5.99.4",
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",