Skip to content

[pluginutils] attachScopes should add scope object to ForStatement.test and ForStatement.update #549

@eight04

Description

@eight04
  • Rollup Plugin Name: pluginutils
  • Rollup Plugin Version: 4.0.0
  • Rollup Version:
  • Operating System (or Browser): Windows 10
  • Node Version: 13.8.0
  • Link to reproduction (⚠️ read below): https://repl.it/repls/WeightyUnnaturalBoolean

Expected Behavior

With the following code,

for (let a = 0; a < 10; a++) {
  console.log(a);
  let b = 10;
}

There are two different scopes. ForStatement.body (i.e. BlockStatement) can access variable a and variable b. However, ForStatement.test and ForStatement.update (i.e. BinaryExpression and UpdateExpression) can only access variable a.

Actual Behavior

attachScopes only attaches scope object to BlockStatement

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions