Skip to content

Commit

Permalink
Use the same passContainingUrl as before
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Apr 13, 2024
1 parent a00beea commit 5929113
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
9 changes: 5 additions & 4 deletions lib/src/async_import_cache.dart
Expand Up @@ -207,16 +207,17 @@ final class AsyncImportCache {
/// that result is cacheable at all.
Future<(AsyncCanonicalizeResult?, bool cacheable)> _canonicalize(
AsyncImporter importer, Uri url, Uri? baseUrl, bool forImport) async {
var containingUrlAvailable =
var passContainingUrl = baseUrl != null &&
(url.scheme == '' || await importer.isNonCanonicalScheme(url.scheme));

var canonicalizeContext =
CanonicalizeContext(containingUrlAvailable ? baseUrl : null, forImport);
CanonicalizeContext(passContainingUrl ? baseUrl : null, forImport);

var result = await withCanonicalizeContext(
canonicalizeContext, () => importer.canonicalize(url));

var cacheable = !containingUrlAvailable ||
!canonicalizeContext.wasContainingUrlAccessed;
var cacheable =
!passContainingUrl || !canonicalizeContext.wasContainingUrlAccessed;

if (result == null) return (null, cacheable);

Expand Down
11 changes: 6 additions & 5 deletions lib/src/import_cache.dart
Expand Up @@ -5,7 +5,7 @@
// DO NOT EDIT. This file was generated from async_import_cache.dart.
// See tool/grind/synchronize.dart for details.
//
// Checksum: 3c180aa4cb4ccae770c2c53d3801fa13873fc17d
// Checksum: 36bc42050cf2eb3a43f36376c4f06c1708eee777
//
// ignore_for_file: unused_import

Expand Down Expand Up @@ -207,16 +207,17 @@ final class ImportCache {
/// that result is cacheable at all.
(CanonicalizeResult?, bool cacheable) _canonicalize(
Importer importer, Uri url, Uri? baseUrl, bool forImport) {
var containingUrlAvailable =
var passContainingUrl = baseUrl != null &&
(url.scheme == '' || importer.isNonCanonicalScheme(url.scheme));

var canonicalizeContext =
CanonicalizeContext(containingUrlAvailable ? baseUrl : null, forImport);
CanonicalizeContext(passContainingUrl ? baseUrl : null, forImport);

var result = withCanonicalizeContext(
canonicalizeContext, () => importer.canonicalize(url));

var cacheable = !containingUrlAvailable ||
!canonicalizeContext.wasContainingUrlAccessed;
var cacheable =
!passContainingUrl || !canonicalizeContext.wasContainingUrlAccessed;

if (result == null) return (null, cacheable);

Expand Down

0 comments on commit 5929113

Please sign in to comment.