From 9299e98c8ace12f6646df27cbccb0dc6c4d55ff0 Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Mon, 7 Jun 2021 16:19:00 -0700 Subject: [PATCH 1/2] Fix a bug with implicit dependencies Encountered this while migrating internal code to math.div --- CHANGELOG.md | 5 +++++ lib/src/async_environment.dart | 13 ++++++++++--- lib/src/environment.dart | 15 +++++++++++---- pubspec.yaml | 2 +- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f69bd3ec8..0eb65aeee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 1.34.2 + +* Fix a bug that could prevent some members from being found in certain files + that use a mix of imports and the module system. + ## 1.34.1 * Fix a bug where `--update` would always compile any file that depends on a diff --git a/lib/src/async_environment.dart b/lib/src/async_environment.dart index dedf2a402..73e0969d2 100644 --- a/lib/src/async_environment.dart +++ b/lib/src/async_environment.dart @@ -210,12 +210,19 @@ class AsyncEnvironment { /// Returns a new environment to use for an imported file. /// /// The returned environment shares this environment's variables, functions, - /// and mixins, but not its modules. + /// and mixins, but excludes most modules (except for global modules that + /// result from importing a file with forwards). AsyncEnvironment forImport() => AsyncEnvironment._( {}, {}, - {}, - {}, + { + for (var module in _globalModules) + if (module is ForwardedModuleView) module + }, + { + for (var entry in _globalModuleNodes.entries) + if (entry.key is ForwardedModuleView) entry.key: entry.value + }, null, null, null, diff --git a/lib/src/environment.dart b/lib/src/environment.dart index 5bde2aeb8..febb97494 100644 --- a/lib/src/environment.dart +++ b/lib/src/environment.dart @@ -5,7 +5,7 @@ // DO NOT EDIT. This file was generated from async_environment.dart. // See tool/grind/synchronize.dart for details. // -// Checksum: 588f0864bb1f889586178c799d91696341ecf218 +// Checksum: 0411d2d782920c2d8293eacf178941c192670e75 // // ignore_for_file: unused_import @@ -217,12 +217,19 @@ class Environment { /// Returns a new environment to use for an imported file. /// /// The returned environment shares this environment's variables, functions, - /// and mixins, but not its modules. + /// and mixins, but excludes most modules (except for global modules that + /// result from importing a file with forwards). Environment forImport() => Environment._( {}, {}, - {}, - {}, + { + for (var module in _globalModules) + if (module is ForwardedModuleView) module + }, + { + for (var entry in _globalModuleNodes.entries) + if (entry.key is ForwardedModuleView) entry.key: entry.value + }, null, null, null, diff --git a/pubspec.yaml b/pubspec.yaml index f27aad41c..bfb9220d2 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.34.1 +version: 1.34.2 description: A Sass implementation in Dart. author: Sass Team homepage: https://github.com/sass/dart-sass From a87d86e39d92de0b76f8b055bbb719265047b60a Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Tue, 8 Jun 2021 12:57:48 -0700 Subject: [PATCH 2/2] Mark version as -dev, since not ready for release --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index bfb9220d2..327c2c250 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.34.2 +version: 1.34.2-dev description: A Sass implementation in Dart. author: Sass Team homepage: https://github.com/sass/dart-sass