We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ad8516 commit adf204bCopy full SHA for adf204b
2 files changed
src/JsNodeVisitor.php
@@ -87,7 +87,12 @@ protected static function getFunctionName(CallExpression $node): ?string
87
case 'Identifier':
88
return $callee->getName();
89
case 'MemberExpression':
90
- return $callee->getProperty()->getName();
+ $property = $callee->getProperty();
91
+
92
+ if ($property->getType() === 'Identifier') {
93
+ return $property->getName();
94
+ }
95
+ return null;
96
default:
97
return null;
98
}
tests/assets/functions.js
@@ -27,4 +27,7 @@ fn9(ARG_8);
27
/* No Related comment 4 */
28
);
29
})
30
-fn13(fn14(fn15('foo')));
+fn13(fn14(fn15('foo')));
31
32
+// https://github.com/php-gettext/JS-Scanner/issues/3
33
+var REACT_ELEMENT_TYPE = typeof Symbol === 'function' && Symbol['for'] && Symbol['for']('react.element') || 0xeac7;
0 commit comments