File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
packages/utilities/var/src Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,10 @@ const thisBlockTypes = [
2626export function isNodeValueEqual (
2727 a : TSESTree . Node ,
2828 b : TSESTree . Node ,
29- initialScopes : [ Scope , Scope ] ,
29+ initialScopes : [
30+ aScope : Scope ,
31+ bScope : Scope ,
32+ ] ,
3033) : boolean {
3134 const [ aScope , bScope ] = initialScopes ;
3235 switch ( true ) {
@@ -97,9 +100,9 @@ export function isNodeValueEqual(
97100 case a . type === AST_NODE_TYPES . ThisExpression
98101 && b . type === AST_NODE_TYPES . ThisExpression : {
99102 if ( aScope . block === bScope . block ) return true ;
100- const fa = AST . traverseUp ( a , AST . isOneOf ( thisBlockTypes ) ) ;
101- const fb = AST . traverseUp ( a , AST . isOneOf ( thisBlockTypes ) ) ;
102- return O . isSome ( fa ) && O . isSome ( fb ) && fa . value === fb . value ;
103+ const aFunction = AST . traverseUp ( a , AST . isOneOf ( thisBlockTypes ) ) ;
104+ const bFunction = AST . traverseUp ( a , AST . isOneOf ( thisBlockTypes ) ) ;
105+ return O . isSome ( aFunction ) && O . isSome ( bFunction ) && aFunction . value === bFunction . value ;
103106 }
104107 default : {
105108 const aStatic = getStaticValue ( a , aScope ) ;
You can’t perform that action at this time.
0 commit comments