You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
AstNode::scope_id(), when called on foo's declaration node
SymbolTable::get_scope_id(), when called with foo's SymbolId
Now, consider this snippet:
(functionfoo(){})()
Here, the following scope ids are equal
the root scope id
AstNode::scope_id(), when called on foo's declaration node
However, the symbol id obtained from SymbolTable::get_scope_id() is not the same as the other two.
I'm not certain what expected behavior here is, whether foo should be considered in the root scope or not, but the scope id for its AstNode and for the Symbol should definitely be the same.
The text was updated successfully, but these errors were encountered:
As mentioned in #4240 (comment), I feel we should have separate types FunctionDeclaration and FunctionExpression. I think this would make it less confusing.
See this test case for a reproduction
In this following scope ids are equal:
AstNode::scope_id()
, when called on foo's declaration nodeSymbolTable::get_scope_id()
, when called with foo'sSymbolId
Now, consider this snippet:
Here, the following scope ids are equal
AstNode::scope_id()
, when called on foo's declaration nodeHowever, the symbol id obtained from
SymbolTable::get_scope_id()
is not the same as the other two.I'm not certain what expected behavior here is, whether foo should be considered in the root scope or not, but the scope id for its AstNode and for the Symbol should definitely be the same.
The text was updated successfully, but these errors were encountered: