diff --git a/CHANGELOG.md b/CHANGELOG.md index 44af3332..9588e3e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ * Produce better errors when expected tokens are missing before a closing brace. +* Avoid crashing when compiling a non-partial stylesheet that exists on the + filesystem next to a partial with the same name. + ### Command-Line Interface * When using `--update`, surface errors when an import doesn't exist even if the diff --git a/lib/src/visitor/async_evaluate.dart b/lib/src/visitor/async_evaluate.dart index 89e0b0cc..bdfdb803 100644 --- a/lib/src/visitor/async_evaluate.dart +++ b/lib/src/visitor/async_evaluate.dart @@ -309,9 +309,6 @@ class _EvaluateVisitor _includedFiles.add(_baseUrl.toString()); } } - - var canonicalUrl = await _importer?.canonicalize(_baseUrl); - if (canonicalUrl != null) _activeImports.add(canonicalUrl); } await visitStylesheet(node); diff --git a/lib/src/visitor/evaluate.dart b/lib/src/visitor/evaluate.dart index c1b7719d..c1e52c6d 100644 --- a/lib/src/visitor/evaluate.dart +++ b/lib/src/visitor/evaluate.dart @@ -5,7 +5,7 @@ // DO NOT EDIT. This file was generated from async_evaluate.dart. // See tool/synchronize.dart for details. // -// Checksum: bb333ed7c02c663af1977b3eb6c666b7bed92c1a +// Checksum: dff931bdeda830c46fb13eac40e1d783f86c7aec import 'async_evaluate.dart' show EvaluateResult; export 'async_evaluate.dart' show EvaluateResult; @@ -314,9 +314,6 @@ class _EvaluateVisitor _includedFiles.add(_baseUrl.toString()); } } - - var canonicalUrl = _importer?.canonicalize(_baseUrl); - if (canonicalUrl != null) _activeImports.add(canonicalUrl); } visitStylesheet(node); diff --git a/test/cli/shared.dart b/test/cli/shared.dart index 52fda601..fb1bc6a9 100644 --- a/test/cli/shared.dart +++ b/test/cli/shared.dart @@ -194,6 +194,21 @@ void sharedTests(Future runSass(Iterable arguments)) { await sass.shouldExit(65); }); + test("gracefully handles a non-partial next to a partial", () async { + await d.file("test.scss", "a {b: c}").create(); + await d.file("_test.scss", "x {y: z}").create(); + + var sass = await runSass(["test.scss"]); + expect( + sass.stdout, + emitsInOrder([ + "a {", + " b: c;", + "}", + ])); + await sass.shouldExit(0); + }); + test("emits warnings on standard error", () async { await d.file("test.scss", "@warn 'aw beans'").create();