File tree Expand file tree Collapse file tree 4 files changed +32
-6
lines changed Expand file tree Collapse file tree 4 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -810,6 +810,20 @@ class AsyncEnvironment {
810
810
forwarded: _forwardedModules);
811
811
}
812
812
813
+ /// Returns a module with the same members and upstream modules as [this] , but
814
+ /// an empty stylesheet and extender.
815
+ ///
816
+ /// This is used when resolving imports, since they need to inject forwarded
817
+ /// members into the current scope. It's the only situation in which a nested
818
+ /// environment can become a module.
819
+ Module toDummyModule () {
820
+ return _EnvironmentModule (
821
+ this ,
822
+ CssStylesheet (const [], SourceFile .decoded (const []).span (0 )),
823
+ Extender .empty,
824
+ forwarded: _forwardedModules);
825
+ }
826
+
813
827
/// Returns the module with the given [namespace] , or throws a
814
828
/// [SassScriptException] if none exists.
815
829
Module _getModule (String namespace) {
Original file line number Diff line number Diff line change 5
5
// DO NOT EDIT. This file was generated from async_environment.dart.
6
6
// See tool/grind/synchronize.dart for details.
7
7
//
8
- // Checksum: 76e7c2e929fc7d19390987069ff3a8c4b3fadfc5
8
+ // Checksum: b5212ffc7c50a8e7e436b25c7c16eb2996da2def
9
9
//
10
10
// ignore_for_file: unused_import
11
11
@@ -815,6 +815,20 @@ class Environment {
815
815
forwarded: _forwardedModules);
816
816
}
817
817
818
+ /// Returns a module with the same members and upstream modules as [this] , but
819
+ /// an empty stylesheet and extender.
820
+ ///
821
+ /// This is used when resolving imports, since they need to inject forwarded
822
+ /// members into the current scope. It's the only situation in which a nested
823
+ /// environment can become a module.
824
+ Module <Callable > toDummyModule () {
825
+ return _EnvironmentModule (
826
+ this ,
827
+ CssStylesheet (const [], SourceFile .decoded (const []).span (0 )),
828
+ Extender .empty,
829
+ forwarded: _forwardedModules);
830
+ }
831
+
818
832
/// Returns the module with the given [namespace] , or throws a
819
833
/// [SassScriptException] if none exists.
820
834
Module <Callable > _getModule (String namespace) {
Original file line number Diff line number Diff line change @@ -1420,8 +1420,7 @@ class _EvaluateVisitor
1420
1420
// Create a dummy module with empty CSS and no extensions to make forwarded
1421
1421
// members available in the current import context and to combine all the
1422
1422
// CSS from modules used by [stylesheet].
1423
- var module = environment.toModule (
1424
- CssStylesheet (const [], stylesheet.span), Extender .empty);
1423
+ var module = environment.toDummyModule ();
1425
1424
_environment.importForwards (module);
1426
1425
1427
1426
if (module.transitivelyContainsCss) {
Original file line number Diff line number Diff line change 5
5
// DO NOT EDIT. This file was generated from async_evaluate.dart.
6
6
// See tool/grind/synchronize.dart for details.
7
7
//
8
- // Checksum: f6a7ece88049e365d88091c14cc8143335a06d75
8
+ // Checksum: 0ad7cedc5ee1d05297c4a8d321d492854742e8ab
9
9
//
10
10
// ignore_for_file: unused_import
11
11
@@ -1417,8 +1417,7 @@ class _EvaluateVisitor
1417
1417
// Create a dummy module with empty CSS and no extensions to make forwarded
1418
1418
// members available in the current import context and to combine all the
1419
1419
// CSS from modules used by [stylesheet].
1420
- var module = environment.toModule (
1421
- CssStylesheet (const [], stylesheet.span), Extender .empty);
1420
+ var module = environment.toDummyModule ();
1422
1421
_environment.importForwards (module);
1423
1422
1424
1423
if (module.transitivelyContainsCss) {
You can’t perform that action at this time.
0 commit comments