File tree Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Expand file tree Collapse file tree 2 files changed +11
-14
lines changed Original file line number Diff line number Diff line change @@ -33,3 +33,11 @@ export function chained() {
33
33
export function templateLiteral ( ) {
34
34
return `foo bar` . split ( ' ' ) ;
35
35
}
36
+
37
+ export default function withThis ( ) {
38
+ return this . foo ( ) ;
39
+ }
40
+
41
+ export default function withNestedMemberExpressions ( ) {
42
+ return this . blub . blob . foo ( ) ;
43
+ }
Original file line number Diff line number Diff line change @@ -28,16 +28,6 @@ const validPossibleStatelessComponentTypes = [
28
28
'ArrowFunctionExpression' ,
29
29
] ;
30
30
31
- function isValidCalleeType ( type ) {
32
- return [
33
- 'Identifier' ,
34
- 'CallExpression' ,
35
- 'ArrayExpression' ,
36
- 'TemplateLiteral' ,
37
- 'Literal'
38
- ] . indexOf ( type ) < 0 ;
39
- }
40
-
41
31
function isJSXElementOrReactCreateElement ( path ) {
42
32
return (
43
33
path . node . type === 'JSXElement' ||
@@ -102,12 +92,11 @@ function returnsJSXElementOrReactCreateElementCall(path) {
102
92
if ( calleeValue . node . type === 'MemberExpression' ) {
103
93
if ( calleeValue . get ( 'object' ) . node . type === 'Identifier' ) {
104
94
resolvedValue = resolveToValue ( calleeValue . get ( 'object' ) ) ;
105
- }
106
- else {
107
- while ( isValidCalleeType ( calleeValue . get ( 'object' ) . node . type ) ) {
95
+ } else if ( types . MemberExpression . check ( calleeValue . node ) ) {
96
+ do {
108
97
calleeValue = calleeValue . get ( 'object' ) ;
109
98
namesToResolve . unshift ( calleeValue . get ( 'property' ) ) ;
110
- }
99
+ } while ( types . MemberExpression . check ( calleeValue . node ) ) ;
111
100
112
101
resolvedValue = resolveToValue ( calleeValue . get ( 'object' ) ) ;
113
102
}
You can’t perform that action at this time.
0 commit comments