@@ -14,10 +14,6 @@ function toString(value) {
1414 return String ( value ) ;
1515}
1616
17- function filterDistinct ( value , index , self ) {
18- return self . indexOf ( value ) === index ;
19- }
20-
2117// Pass in a value string to parse/resolve and a map of available values
2218// and we can figure out the final value
2319//
@@ -32,7 +28,7 @@ var resolveValue = function(decl, map, /*optional*/ignorePseudoScope, /*internal
3228 var matchingVarDecl = undefined ;
3329 var resultantValue = toString ( decl . value ) ;
3430 var warnings = [ ] ;
35-
31+
3632 // Match all variables first so we can later on if there are circular dependencies
3733 var variablesUsedInValueMap = { }
3834 // Create a temporary variable, storing resultantValue variable value
@@ -61,7 +57,7 @@ var resolveValue = function(decl, map, /*optional*/ignorePseudoScope, /*internal
6157
6258 // Resolve any var(...) substitutons
6359 var isResultantValueUndefined = false ;
64-
60+
6561 // var() = var( <custom-property-name> [, <any-value> ]? )
6662 // matches `name[, fallback]`, captures "name" and "fallback"
6763 // See: http://dev.w3.org/csswg/css-variables/#funcdef-var
@@ -75,7 +71,7 @@ var resolveValue = function(decl, map, /*optional*/ignorePseudoScope, /*internal
7571 // Get variable name and fallback, filtering empty items
7672 var variableName = variableFallbackSplitPieces [ 0 ] . trim ( ) ;
7773 var fallback = variableFallbackSplitPieces . length > 1 ? variableFallbackSplitPieces . slice ( 1 ) . join ( ',' ) . trim ( ) : undefined ;
78-
74+
7975 ( map [ variableName ] || [ ] ) . forEach ( function ( varDeclMapItem ) {
8076 // Make sure the variable declaration came from the right spot
8177 // And if the current matching variable is already important, a new one to replace it has to be important
0 commit comments