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
I feel there is a small bug when walking the AST for AssignmentExpression, where the LeftHandSideExpression can be a MemberExpression as well in addition to Pattern.
This is a not bug.
Currently, escope does not support property references.
document.cookie="key=value";
In this case, a reading reference of document is needed. It's correct. If document is null, we see a null reference access error.
If there is a writing property reference of document.cookie additionally, it's very useful.
I feel there is a small bug when walking the AST for
AssignmentExpression
, where theLeftHandSideExpression
can be aMemberExpression
as well in addition toPattern
.Currently, the code only considers the
Pattern
type: https://github.com/estools/escope/blob/master/src/referencer.js#L460Hence, a valid
MemberExpression
assignment like,would not be stored as a proper
WriteExpr
in the Reference object. Rather there would be one referenece fordocument
with a Flag of 1(READ).Such assignment expressions are alteast very common in browser JavaScript code and a fix would be great. I know the code also, references something similar in the comments: https://github.com/estools/escope/blob/master/src/referencer.js#L98
If its considered a bug, any tips on how to fix this would be greatly appreciated, since I can work on a PR.
The text was updated successfully, but these errors were encountered: