10BC0 Fix quiet deps when loaded through an @import of a file without @use … · nullcatalyst/dart-sass@0f68d7a · GitHub
[go: up one dir, main page]

Skip to content

Commit 0f68d7a

Browse files
authored
Fix quiet deps when loaded through an @import of a file without @use (sass#1362)
Closes sass#1360
1 parent 7e37166 commit 0f68d7a

File tree

5 files changed

+38
-2
lines changed

5 files changed

+38
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 1.35.1
2+
3+
* Fix a bug where the quiet dependency flag didn't silence warnings in some
4+
stylesheets loaded using `@import`.
5+
16
## 1.35.0
27

38
* Fix a couple bugs that could prevent some members from being found in certain

lib/src/visitor/async_evaluate.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1480,11 +1480,14 @@ class _EvaluateVisitor
14801480
if (stylesheet.uses.isEmpty && stylesheet.forwards.isEmpty) {
14811481
var oldImporter = _importer;
14821482
var oldStylesheet = _stylesheet;
1483+
var oldInDependency = _inDependency;
14831484
_importer = result.importer;
14841485
_stylesheet = stylesheet;
1486+
_inDependency = result.isDependency;
14851487
await visitStylesheet(stylesheet);
14861488
_importer = oldImporter;
14871489
_stylesheet = oldStylesheet;
1490+
_inDependency = oldInDependency;
14881491
_activeModules.remove(url);
14891492
return;
14901493
}

lib/src/visitor/evaluate.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_evaluate.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: 203ba98fd9ca92ccc0b6465fd0d617e88c8dd37e
8+
// Checksum: 1249b1184a46950409776772cb1c6003b80ebb31
99
//
1010
// ignore_for_file: unused_import
1111

@@ -1479,11 +1479,14 @@ class _EvaluateVisitor
14791479
if (stylesheet.uses.isEmpty && stylesheet.forwards.isEmpty) {
14801480
var oldImporter = _importer;
14811481
var oldStylesheet = _stylesheet;
1482+
var oldInDependency = _inDependency;
14821483
_importer = result.importer;
14831484
_stylesheet = stylesheet;
1485+
_inDependency = result.isDependency;
14841486
visitStylesheet(stylesheet);
14851487
_importer = oldImporter;
14861488
_stylesheet = oldStylesheet;
1489+
_inDependency = oldInDependency;
14871490
_activeModules.remove(url);
14881491
return;
14891492
}

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.35.0
2+
version: 1.35.1
33
description: A Sass implementation in Dart.
44
author: Sass Team
55
homepage: https://github.com/sass/dart-sass

test/cli/shared.dart

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,31 @@ void sharedTests(
481481
await sass.shouldExit(0);
482482
});
483483
});
484+
485+
group("silences warnings through @import", () {
486+
test("of a file without @use", () async {
487+
await d.file("test.scss", "@import 'other'").create();
488+
await d.dir("dir", [d.file("_other.scss", "#{blue} {x: y}")]).create();
489+
490+
var sass = await runSass(["--quiet-deps", "-I", "dir", "test.scss"]);
491+
expect(sass.stderr, emitsDone);
492+
await sass.shouldExit(0);
493+
});
494+
495+
test("of a file with @use", () async {
496+
await d.file("test.scss", "@import 'other'").create();
497+
await d.dir("dir", [
498+
d.file("_other.scss", """
499+
@use 'sass:color';
500+
#{blue} {x: y}
501+
""")
502+
]).create();
503+
504+
var sass = await runSass(["--quiet-deps", "-I", "dir", "test.scss"]);
505+
expect(sass.stderr, emitsDone);
506+
await sass.shouldExit(0);
507+
});
508+
});
484509
});
485510

486511
group("with a bunch of deprecation warnings", () {

0 commit comments

Comments
 (0)
0