From 720b1d053fca3c98314abb209c3810d57cf59ab9 Mon Sep 17 00:00:00 2001 From: 59naga Date: Tue, 26 Jun 2018 04:54:18 +0900 Subject: [PATCH] fix(#54): modify guard clause(only access real properties) --- src/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 7d6d9fb..7ed9a2b 100644 --- a/src/index.js +++ b/src/index.js @@ -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 } @@ -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 }