Skip to content

Commit 1ba4151

Browse files
committed
Fix bug with implicit configuration for nested imports
Actually fixes #2641
1 parent b8b35e8 commit 1ba4151

File tree

8 files changed

+34
-18
lines changed

8 files changed

+34
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.93.3
2+
3+
* Additional fixes for implicit configuration when nested imports are involved.
4+
15
## 1.93.2
26

37
* No user-visible changes.

lib/src/async_environment.dart

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ final class AsyncEnvironment {
223223
{},
224224
_importedModules,
225225
null,
226-
null,
226+
_nestedForwardedModules,
227227
[],
228228
_variables.toList(),
229229
_variableNodes.toList(),
@@ -834,13 +834,15 @@ final class AsyncEnvironment {
834834
/// environment.
835835
Configuration toImplicitConfiguration() {
836836
var configuration = <String, ConfiguredValue>{};
837-
for (var module in _importedModules.keys) {
838-
for (var (name, value) in module.variables.pairs) {
839-
configuration[name] =
840-
ConfiguredValue.implicit(value, module.variableNodes[name]!);
841-
}
842-
}
843837
for (var i = 0; i < _variables.length; i++) {
838+
var modules =
839+
i == 0 ? _importedModules.keys : _nestedForwardedModules?[i - 1];
840+
for (var module in modules ?? <Module>[]) {
841+
for (var (name, value) in module.variables.pairs) {
842+
configuration[name] =
843+
ConfiguredValue.implicit(value, module.variableNodes[name]!);
844+
}
845+
}
844846
var values = _variables[i];
845847
var nodes = _variableNodes[i];
846848
for (var (name, value) in values.pairs) {

lib/src/environment.dart

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_environment.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: 608af187f35a7483a87d8a54e97793e776ba215c
8+
// Checksum: a2860c59c051b8353caa4dc0767f7b803b8b5582
99
//
1010
// ignore_for_file: unused_import
1111

@@ -230,7 +230,7 @@ final class Environment {
230230
{},
231231
_importedModules,
232232
null,
233-
null,
233+
_nestedForwardedModules,
234234
[],
235235
_variables.toList(),
236236
_variableNodes.toList(),
@@ -842,13 +842,15 @@ final class Environment {
842842
/// environment.
843843
Configuration toImplicitConfiguration() {
844844
var configuration = <String, ConfiguredValue>{};
845-
for (var module in _importedModules.keys) {
846-
for (var (name, value) in module.variables.pairs) {
847-
configuration[name] =
848-
ConfiguredValue.implicit(value, module.variableNodes[name]!);
849-
}
850-
}
851845
for (var i = 0; i < _variables.length; i++) {
846+
var modules =
847+
i == 0 ? _importedModules.keys : _nestedForwardedModules?[i - 1];
848+
for (var module in modules ?? <Module<Callable>>[]) {
849+
for (var (name, value) in module.variables.pairs) {
850+
configuration[name] =
851+
ConfiguredValue.implicit(value, module.variableNodes[name]!);
852+
}
853+
}
852854
var values = _variables[i];
853855
var nodes = _variableNodes[i];
854856
for (var (name, value) in values.pairs) {

pkg/sass-parser/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.32
2+
3+
* No user-visible changes.
4+
15
## 0.4.31
26

37
* No user-visible changes.

pkg/sass-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-parser",
3-
"version": "0.4.31",
3+
"version": "0.4.32",
44
"description": "A PostCSS-compatible wrapper of the official Sass parser",
55
"repository": "sass/sass",
66
"author": "Google Inc.",

pkg/sass_api/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 15.12.3
2+
3+
* No user-visible changes.
4+
15
## 15.12.2
26

37
* No user-visible changes.

pkg/sass_api/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: sass_api
22
# Note: Every time we add a new Sass AST node, we need to bump the *major*
33
# version because it's a breaking change for anyone who's implementing the
44
# visitor interface(s).
5-
version: 15.12.2
5+
version: 15.12.3
66
description: Additional APIs for Dart Sass.
77
homepage: https://github.com/sass/dart-sass
88

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.93.2
2+
version: 1.93.3
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)