File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -274,15 +274,23 @@ export class BaseVariableResolver {
274274
275275 const reversedVariables = [ ...scopeVariables , ...parentsScopeVariables ] . reverse ( ) ;
276276
277+ const seenNames = new Set ( ) ;
278+
277279 return reversedVariables . filter ( variable => {
278280
279281 // if external variable, keep
280282 if ( variable . provider . find ( extractor => extractor !== this . _baseExtractor ) ) {
281283 return true ;
282284 }
283285
284- // if not external, keep only if first of its name
285- return reversedVariables . find ( v => v . name === variable . name ) === variable ;
286+ // if not external, keep only the first occurrence of each name
287+ if ( ! seenNames . has ( variable . name ) ) {
288+ seenNames . add ( variable . name ) ;
289+
290+ return true ;
291+ }
292+
293+ return false ;
286294 } ) ;
287295 }
288296}
You can’t perform that action at this time.
0 commit comments