We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 11e42ba commit 70eeb92Copy full SHA for 70eeb92
lib/util/variable.js
@@ -62,8 +62,8 @@ function variablesInScope(context, node) {
62
* @param {string} name The name of the variable to search.
63
* @returns {ASTNode|null} Return null if the variable could not be found, ASTNode otherwise.
64
*/
65
-function findVariableByName(context, node, name = node.name) {
66
- const variable = getVariable(variablesInScope(context, node), name);
+function findVariableByName(context, node, name) {
+ const variable = getVariable(variablesInScope(context, node), name || node.name);
67
68
if (!variable || !variable.defs[0] || !variable.defs[0].node) {
69
return null;
0 commit comments