File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
modules/code-generator/src/utils Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,7 @@ export function parseExpressionConvertThis2Context(
271271
272272 const localVariablesSet = new Set ( localVariables ) ;
273273
274- let thisScopeLevel = CROSS_THIS_SCOPE_TYPE_NODE [ exprAst . type ] ? - 1 : 0 ;
274+ let thisScopeLevel = - 1 ;
275275 traverse ( fileAst , {
276276 enter ( path ) {
277277 if ( CROSS_THIS_SCOPE_TYPE_NODE [ path . node . type ] ) {
@@ -303,7 +303,7 @@ export function parseExpressionConvertThis2Context(
303303 }
304304
305305 // 替换 this (只在顶层替换)
306- if ( thisScopeLevel < = 0 ) {
306+ if ( thisScopeLevel == = 0 ) {
307307 obj . replaceWith ( t . identifier ( contextName ) ) ;
308308 }
309309 } ,
@@ -317,7 +317,7 @@ export function parseExpressionConvertThis2Context(
317317 return ;
318318 }
319319
320- if ( thisScopeLevel < = 0 ) {
320+ if ( thisScopeLevel == = 0 ) {
321321 path . replaceWith ( t . identifier ( contextName ) ) ;
322322 }
323323 } ,
You can’t perform that action at this time.
0 commit comments