mirror of
https://github.com/danog/dart-sass.git
synced 2024-11-30 04:39:03 +01:00
Fix @debug on stdin (#493)
This commit is contained in:
parent
89aa34c28e
commit
0620ccc19a
@ -1,3 +1,9 @@
|
|||||||
|
## 1.14.2
|
||||||
|
|
||||||
|
### Command-Line Interface
|
||||||
|
|
||||||
|
* Don't crash when using `@debug` in a stylesheet passed on standard input.
|
||||||
|
|
||||||
## 1.14.1
|
## 1.14.1
|
||||||
|
|
||||||
* Canonicalize escaped digits at the beginning of identifiers as hex escapes.
|
* Canonicalize escaped digits at the beginning of identifiers as hex escapes.
|
||||||
|
@ -44,8 +44,9 @@ class StderrLogger implements Logger {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void debug(String message, SourceSpan span) {
|
void debug(String message, SourceSpan span) {
|
||||||
stderr
|
var url =
|
||||||
.write('${p.prettyUri(span.start.sourceUrl)}:${span.start.line + 1} ');
|
span.start.sourceUrl == null ? '-' : p.prettyUri(span.start.sourceUrl);
|
||||||
|
stderr.write('$url:${span.start.line + 1} ');
|
||||||
stderr.write(color ? '\u001b[1mDebug\u001b[0m' : 'DEBUG');
|
stderr.write(color ? '\u001b[1mDebug\u001b[0m' : 'DEBUG');
|
||||||
stderr.writeln(': $message');
|
stderr.writeln(': $message');
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: sass
|
name: sass
|
||||||
version: 1.14.1
|
version: 1.14.2-dev
|
||||||
description: A Sass implementation in Dart.
|
description: A Sass implementation in Dart.
|
||||||
author: Dart Team <misc@dartlang.org>
|
author: Dart Team <misc@dartlang.org>
|
||||||
homepage: https://github.com/sass/dart-sass
|
homepage: https://github.com/sass/dart-sass
|
||||||
|
@ -202,6 +202,15 @@ void sharedTests(Future<TestProcess> runSass(Iterable<String> arguments)) {
|
|||||||
]));
|
]));
|
||||||
await sass.shouldExit(0);
|
await sass.shouldExit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Regression test.
|
||||||
|
test("supports @debug", () async {
|
||||||
|
var sass = await runSass(["--no-source-map", "--stdin"]);
|
||||||
|
sass.stdin.writeln("@debug foo");
|
||||||
|
sass.stdin.close();
|
||||||
|
expect(sass.stderr, emitsInOrder(["-:1 DEBUG: foo"]));
|
||||||
|
await sass.shouldExit(0);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
test("gracefully reports errors from stdin", () async {
|
test("gracefully reports errors from stdin", () async {
|
||||||
|
Loading…
Reference in New Issue
Block a user