Skip to content

Commit 720b1d0

Browse files
committed
fix(#54): modify guard clause(only access real properties)
1 parent b67ab83 commit 720b1d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ class AssignmentReminder {
55
}
66
evaluateExpression (path, property = 'expression') {
77
// Not `exports.anything`, skip
8-
if (!path.get(`${property}.left`).node || !path.get(`${property}.left.property`).node) {
8+
if (!path.get(`${property}.left`).node || !path.get(`${property}.left.object`).node) {
99
return
1010
}
1111

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

0 commit comments

Comments
 (0)