Skip to content

Conversation

@pmdartus
Copy link
Contributor

@pmdartus pmdartus commented Jun 3, 2021

This PR adds extra guards to the scope resolution to prevent issues when the call expression identifier can't be resolved in the current scope.

Fixes #4.

@pmdartus pmdartus requested review from jodarove and trevor-bliss June 3, 2021 13:10
create(context) {
function isApexMethodReference(ref) {
const [def] = ref.defs;
function isApexMethodReference(variable) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes in this file are to readjust the variable name. Everything used to be called a reference, when it is actually 2 different concepts in ESLint: Reference and Variable.

if (!methodReference || !isApexMethodReference(methodReference)) {
if (
!methodReference ||
!methodReference.resolved ||
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The key difference is here. In some cases, Reference.resolved might be undefined. The fix is to add this extra check.

Copy link
Contributor

@jodarove jodarove left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@pmdartus pmdartus merged commit 837ebc7 into master Jun 4, 2021
@pmdartus pmdartus deleted the pmdartus/fix-mixin branch June 4, 2021 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

valid-apex-method-invocation throws an error when using NavigationMixin

2 participants