From 5d4950db369c04a55a41cf0dc6fb5db9acc4e6c2 Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Wed, 12 May 2021 09:09:35 -0700 Subject: [PATCH] Fix bug with null values in configuration (#1305) Fixes #1281. --- CHANGELOG.md | 4 ++++ lib/src/visitor/async_evaluate.dart | 2 +- lib/src/visitor/evaluate.dart | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e668f740d..f38ea879e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ ## 1.32.13 +* **Potentially breaking bug fix:** Null values in `@use` and `@forward` + configurations no longer override the `!default` variable, matching the + behavior of the equivalent code using `@import`. + * Use the proper parameter names in error messages about `string.slice` ## 1.32.12 diff --git a/lib/src/visitor/async_evaluate.dart b/lib/src/visitor/async_evaluate.dart index fe10027db..1c7fe64d5 100644 --- a/lib/src/visitor/async_evaluate.dart +++ b/lib/src/visitor/async_evaluate.dart @@ -1918,7 +1918,7 @@ class _EvaluateVisitor if (node.isGuarded) { if (node.namespace == null && _environment.atRoot) { var override = _configuration.remove(node.name); - if (override != null) { + if (override != null && override.value != sassNull) { _addExceptionSpan(node, () { _environment.setVariable( node.name, override.value, override.assignmentNode, diff --git a/lib/src/visitor/evaluate.dart b/lib/src/visitor/evaluate.dart index e57a0cc65..fe2618329 100644 --- a/lib/src/visitor/evaluate.dart +++ b/lib/src/visitor/evaluate.dart @@ -5,7 +5,7 @@ // DO NOT EDIT. This file was generated from async_evaluate.dart. // See tool/grind/synchronize.dart for details. // -// Checksum: acaafcfe17e8cb582fb01ea8b95afaf871af4eed +// Checksum: 648f9a2041613a8f11c46986b4b4d4ccbaa0c489 // // ignore_for_file: unused_import @@ -1910,7 +1910,7 @@ class _EvaluateVisitor if (node.isGuarded) { if (node.namespace == null && _environment.atRoot) { var override = _configuration.remove(node.name); - if (override != null) { + if (override != null && override.value != sassNull) { _addExceptionSpan(node, () { _environment.setVariable( node.name, override.value, override.assignmentNode, diff --git a/pubspec.yaml b/pubspec.yaml index 9195721c2..9ff25ca83 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.32.13-dev +version: 1.32.13 description: A Sass implementation in Dart. author: Sass Team homepage: https://github.com/sass/dart-sass