Skip to content

Commit

Permalink
🐛 fix hasSideEffect false negative
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Jul 14, 2019
1 parent aac472e commit cb518c7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/api/ast-utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ The side effect means that it *may* modify a certain variable or object member.
- `AssignmentExpression`
- `AwaitExpression`
- `CallExpression`
- `ImportExpression`
- `NewExpression`
- `UnaryExpression` (`[operator = "delete"]`)
- `UpdateExpression`
Expand Down
3 changes: 3 additions & 0 deletions src/has-side-effect.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ const visitor = Object.freeze(
FunctionExpression() {
return false
},
ImportExpression() {
return true
},
MemberExpression(node, options, visitorKeys) {
if (options.considerGetters) {
return true
Expand Down

0 comments on commit cb518c7

Please sign in to comment.