mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-22 13:51:31 +01:00
Fix for importers that return null in load
(#1139)
This commit is contained in:
parent
6986dcf718
commit
4f1f5c9de8
@ -3,6 +3,11 @@
|
||||
* Fix a bug where `@at-root (without: all)` wouldn't properly remove a
|
||||
`@keyframes` context when parsing selectors.
|
||||
|
||||
### Dart API
|
||||
|
||||
* Fix a bug that prevented importers from returning null when loading from a
|
||||
URL that they had already canonicalized.
|
||||
|
||||
## 1.29.0
|
||||
|
||||
* Support a broader syntax for `@supports` conditions, based on the latest
|
||||
|
@ -162,6 +162,7 @@ Relative canonical URLs are deprecated and will eventually be disallowed.
|
||||
baseImporter: baseImporter, baseUrl: baseUrl, forImport: forImport);
|
||||
if (tuple == null) return null;
|
||||
var stylesheet = importCanonical(tuple.item1, tuple.item2, tuple.item3);
|
||||
if (stylesheet == null) return null;
|
||||
return Tuple2(tuple.item1, stylesheet);
|
||||
}
|
||||
|
||||
|
@ -168,4 +168,17 @@ void main() {
|
||||
return true;
|
||||
})));
|
||||
});
|
||||
|
||||
test("avoids importer when only load() returns null", () {
|
||||
expect(() {
|
||||
compileString('@import "orange";', importers: [
|
||||
TestImporter((url) => Uri.parse("u:$url"), (url) => null)
|
||||
]);
|
||||
}, throwsA(predicate((error) {
|
||||
expect(error, const TypeMatcher<SassException>());
|
||||
expect(error.toString(),
|
||||
startsWith("Error: Can't find stylesheet to import"));
|
||||
return true;
|
||||
})));
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user