Skip to content

bug(semantic): AstNode has incorrect ScopeId #4436

@DonIsaac

Description

@DonIsaac

playground link

function foo(cb) { cb = function() { function something(a) { cb(1 + a); } register(something); }(); } foo();
//                                                           ^^^^^^^^^ 

To reproduce:

  1. get The first read reference for cb (it has a node whose Id is for the above CallExpression)
  2. Get the ScopeId pointed to by that Reference
  3. Get the node associated with that ScopeId
  4. Notice that it's the anonymous function wrapping something, when it should be the something function

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions