55// DO NOT EDIT. This file was generated from async_import_cache.dart.
66// See tool/grind/synchronize.dart for details.
77//
8- // Checksum: 37dd173d676ec6cf201a25b3cca9ac81d92b1433
8+ // Checksum: 36bc42050cf2eb3a43f36376c4f06c1708eee777
99//
1010// ignore_for_file: unused_import
1111
@@ -18,6 +18,7 @@ import 'package:path/path.dart' as p;
1818import 'ast/sass.dart' ;
1919import 'deprecation.dart' ;
2020import 'importer.dart' ;
21+ import 'importer/canonicalize_context.dart' ;
2122import 'importer/no_op.dart' ;
2223import 'importer/utils.dart' ;
2324import 'io.dart' ;
@@ -206,18 +207,17 @@ final class ImportCache {
206207 /// that result is cacheable at all.
207208 (CanonicalizeResult ? , bool cacheable) _canonicalize (
208209 Importer importer, Uri url, Uri ? baseUrl, bool forImport) {
209- var canonicalize = forImport
210- ? () => inImportRule (() => importer.canonicalize (url))
211- : () => importer.canonicalize (url);
212-
213210 var passContainingUrl = baseUrl != null &&
214211 (url.scheme == '' || importer.isNonCanonicalScheme (url.scheme));
215- var result =
216- withContainingUrl (passContainingUrl ? baseUrl : null , canonicalize);
217212
218- // TODO(sass/dart-sass#2208): Determine whether the containing URL was
219- // _actually_ accessed rather than assuming it was.
220- var cacheable = ! passContainingUrl || importer is FilesystemImporter ;
213+ var canonicalizeContext =
214+ CanonicalizeContext (passContainingUrl ? baseUrl : null , forImport);
215+
216+ var result = withCanonicalizeContext (
217+ canonicalizeContext, () => importer.canonicalize (url));
218+
219+ var cacheable =
220+ ! passContainingUrl || ! canonicalizeContext.wasContainingUrlAccessed;
221221
222222 if (result == null ) return (null , cacheable);
223223
0 commit comments