Skip to content

Commit

Permalink
Make LazyFileSpans work in JavaScript (#2142)
Browse files Browse the repository at this point in the history
Closes #1952
  • Loading branch information
nex3 authored Dec 5, 2023
1 parent 13830a5 commit bd80c58
Show file tree
Hide file tree
Showing 3 changed files with 11 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.69.6

### JS API

* Fix a bug where certain exceptions could produce `SourceSpan`s that didn't
follow the documented `SourceSpan` API.

## 1.69.5

### JS API
Expand Down
4 changes: 3 additions & 1 deletion lib/src/js/source_span.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import 'package:source_span/source_span.dart';

import '../util/lazy_file_span.dart';
import '../util/multi_span.dart';
import '../util/nullable.dart';
import 'reflection.dart';
Expand All @@ -14,8 +15,9 @@ import 'utils.dart';
void updateSourceSpanPrototype() {
var span = SourceFile.fromString('').span(0);
var multiSpan = MultiSpan(span, '', {});
var lazySpan = LazyFileSpan(() => span);

for (var item in [span, multiSpan]) {
for (var item in [span, multiSpan, lazySpan]) {
getJSClass(item).defineGetters({
'start': (FileSpan span) => span.start,
'end': (FileSpan span) => span.end,
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.69.5
version: 1.69.6-dev
description: A Sass implementation in Dart.
homepage: https://github.com/sass/dart-sass

Expand Down

0 comments on commit bd80c58

Please sign in to comment.