mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 22:02:00 +01:00
a95c5b8ccb
Doing this for variable *nodes* was breaking in extremely specific circumstances: * A null node is passed into setVariable() and, if source maps are enabled, recorded in _variableNodes. * Later on, getVariableNode() is called for that variable. Because that variable's node is null, it calls _getVariableNodeFromGlobalModule() even though the variable is actually defined. * _getVariableNodeFromGlobalModule() sets _lastVariableIndex to 0 on the assumption that the variable is undefined, which turns out to be incorrect in this specific case. The next commit will fix the issue where a null node can be passed into setVariable() when source maps are enabled, but it makes more sense to assign the variable index to 0 in the variable access anyway, since it happens first and isn't skipped when source maps are disabled.