Skip to content

Commit

Permalink
Make LazyFileSpans work in JavaScript (sass#2142)
Browse files Browse the repository at this point in the history
Closes sass#1952
  • Loading branch information
nex3 authored and Ludwig Meysel committed Feb 20, 2024
1 parent d050a64 commit bdc95ec
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 bdc95ec

Please sign in to comment.