Skip to content

minifier: block statements are not inlined in some cases #8708

@sapphi-red

Description

@sapphi-red

Compress

function z(a) {
  {
    for (var i = 0; i < a; i++) {}
    console.log()
  }
  console.log()
}

into

function z(a) {
  for (var i = 0; i < a; i++) {}
  console.log()
  console.log()
}

. This is safe because the block statement does not include lexical variable declarations.

If I remove the for loop or the console.log in the block, the block is inlined.

Metadata

Metadata

Assignees

Labels

C-enhancementCategory - New feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions