Skip to content

Commit

Permalink
fix(#54): modify guard clause(only access real properties)
Browse files Browse the repository at this point in the history
  • Loading branch information
59naga committed Jun 25, 2018
1 parent b67ab83 commit 720b1d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class AssignmentReminder {
}
evaluateExpression (path, property = 'expression') {
// Not `exports.anything`, skip
if (!path.get(`${property}.left`).node || !path.get(`${property}.left.property`).node) {
if (!path.get(`${property}.left`).node || !path.get(`${property}.left.object`).node) {
return
}

Expand All @@ -25,7 +25,7 @@ module.exports = ({types}) => ({
CallExpression: {
exit (path, state) {
// Not `Object.defineProperty`, skip
if (path.get('callee.name').node) {
if (!path.get('callee.object').node) {
return
}

Expand Down

0 comments on commit 720b1d0

Please sign in to comment.