| | |
| | | unaryExpression |
| | | } = _t; |
| | | |
| | | function simplifyAccess(path, bindingNames) { |
| | | function simplifyAccess(path, bindingNames, includeUpdateExpression = true) { |
| | | path.traverse(simpleAssignmentVisitor, { |
| | | scope: path.scope, |
| | | bindingNames, |
| | | seen: new WeakSet() |
| | | seen: new WeakSet(), |
| | | includeUpdateExpression |
| | | }); |
| | | } |
| | | |
| | |
| | | exit(path) { |
| | | const { |
| | | scope, |
| | | bindingNames |
| | | bindingNames, |
| | | includeUpdateExpression |
| | | } = this; |
| | | |
| | | if (!includeUpdateExpression) { |
| | | return; |
| | | } |
| | | |
| | | const arg = path.get("argument"); |
| | | if (!arg.isIdentifier()) return; |
| | | const localName = arg.node.name; |