Skip to content

Commit

Permalink
Pass undefined span instead of null to Logger.warn() in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Jan 4, 2022
1 parent 169178a commit d2fc580
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.45.3

### JS API

* **Potentially breaking bug fix:** Match the specification of the new JS API by
passing `undefined` rather than `null` to `Logger.warn()` for an unset `span`.

## 1.45.2

### JS API
Expand Down
5 changes: 4 additions & 1 deletion lib/src/logger/node_to_dart.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// MIT-style license that can be found in the LICENSE file or at
// https://opensource.org/licenses/MIT.

import 'package:node_interop/js.dart';
import 'package:source_span/source_span.dart';
import 'package:stack_trace/stack_trace.dart';
import 'package:term_glyph/term_glyph.dart' as glyph;
Expand Down Expand Up @@ -38,7 +39,9 @@ class NodeToDartLogger implements Logger {
warn(
message,
WarnOptions(
span: span, stack: trace.toString(), deprecation: deprecation));
span: span ?? (undefined as SourceSpan?),
stack: trace.toString(),
deprecation: deprecation));
}
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: sass
version: 1.45.2
version: 1.45.3
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit d2fc580

Please sign in to comment.