Skip to content

binding vs. uid API methods #2101

@DmitrySoshnikov

Description

@DmitrySoshnikov

The destructuring generates for the:

var {foo} = require('bar');

the following code:

var _require = require('bar');
var foo = _require.foo;

The _require var goes to the uids instead of bindings, however, scope.hasBinding returns true since considers uids.

Then our "after" plugin removes the var _require = require('bar'); node, in order to inline the call. However, scope.removeBindings doesn't affect it, since it's not in bindings, but in uids.

We should probably add such generated vars to bindings as well, or to expose scope.removeUid method. And also scope.hasBinding (returns true) is kind of inconsistent after scope.removeBinding (which does nothing in this case).

Metadata

Metadata

Assignees

No one assigned

    Labels

    outdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions