From 12f89c1d451256038bccef23ac4160ed3c37c627 Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Wed, 14 Sep 2022 13:47:19 -0700 Subject: [PATCH 1/2] Fix bug in JS MultiSpan Fixes #1790. --- CHANGELOG.md | 7 +++++++ lib/src/node/source_span.dart | 18 +++++++++++------- pkg/sass_api/CHANGELOG.md | 4 ++++ pkg/sass_api/pubspec.yaml | 4 ++-- pubspec.yaml | 2 +- 5 files changed, 25 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d59652f7f..de682ce11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.55.1 + +### JS API + +* Fix a bug in which certain warning spans would not have their properties + accessible by the JS API. + ## 1.55.0 ### Dart API diff --git a/lib/src/node/source_span.dart b/lib/src/node/source_span.dart index 7b7566811..998db03ad 100644 --- a/lib/src/node/source_span.dart +++ b/lib/src/node/source_span.dart @@ -4,6 +4,7 @@ import 'package:source_span/source_span.dart'; +import '../util/multi_span.dart'; import '../util/nullable.dart'; import 'reflection.dart'; import 'utils.dart'; @@ -12,14 +13,17 @@ import 'utils.dart'; /// that they match the JS API. void updateSourceSpanPrototype() { var span = SourceFile.fromString('').span(0); + var multiSpan = MultiSpan(span, '', {}); - getJSClass(span).defineGetters({ - 'start': (FileSpan span) => span.start, - 'end': (FileSpan span) => span.end, - 'url': (FileSpan span) => span.sourceUrl.andThen(dartToJSUrl), - 'text': (FileSpan span) => span.text, - 'context': (FileSpan span) => span.context, - }); + for (var item in [span, multiSpan]) { + getJSClass(item).defineGetters({ + 'start': (FileSpan span) => span.start, + 'end': (FileSpan span) => span.end, + 'url': (FileSpan span) => span.sourceUrl.andThen(dartToJSUrl), + 'text': (FileSpan span) => span.text, + 'context': (FileSpan span) => span.context, + }); + } // Offset is already accessible from JS because it's defined as a field rather // than a getter. diff --git a/pkg/sass_api/CHANGELOG.md b/pkg/sass_api/CHANGELOG.md index 7b35160c9..82a0a9f3b 100644 --- a/pkg/sass_api/CHANGELOG.md +++ b/pkg/sass_api/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.1.1 + +* No user-visible changes. + ## 3.1.0 ### Dart API diff --git a/pkg/sass_api/pubspec.yaml b/pkg/sass_api/pubspec.yaml index ac509de08..f7a0b0f5d 100644 --- a/pkg/sass_api/pubspec.yaml +++ b/pkg/sass_api/pubspec.yaml @@ -2,7 +2,7 @@ name: sass_api # Note: Every time we add a new Sass AST node, we need to bump the *major* # version because it's a breaking change for anyone who's implementing the # visitor interface(s). -version: 3.1.0 +version: 3.1.1 description: Additional APIs for Dart Sass. homepage: https://github.com/sass/dart-sass @@ -10,7 +10,7 @@ environment: sdk: ">=2.17.0 <3.0.0" dependencies: - sass: 1.55.0 + sass: 1.55.1 dev_dependencies: dartdoc: ^5.0.0 diff --git a/pubspec.yaml b/pubspec.yaml index 92542939c..2dbdf0258 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.55.0 +version: 1.55.1 description: A Sass implementation in Dart. homepage: https://github.com/sass/dart-sass From be5542fdf3973564f7256965f71e39205ee071ec Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Wed, 14 Sep 2022 17:01:01 -0700 Subject: [PATCH 2/2] Update pubspec to -dev version --- CHANGELOG.md | 12 +++++------- pkg/sass_api/CHANGELOG.md | 4 ---- pkg/sass_api/pubspec.yaml | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 8 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de682ce11..3ebee22e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,3 @@ -## 1.55.1 - -### JS API - -* Fix a bug in which certain warning spans would not have their properties - accessible by the JS API. - ## 1.55.0 ### Dart API @@ -12,6 +5,11 @@ * Add an optional `argumentName` parameter to `SassScriptException()` to make it easier to throw exceptions associated with particular argument names. +### JS API + +* Fix a bug in which certain warning spans would not have their properties + accessible by the JS API. + ## 1.54.9 * Fix an incorrect span in certain `@media` query deprecation warnings. diff --git a/pkg/sass_api/CHANGELOG.md b/pkg/sass_api/CHANGELOG.md index 82a0a9f3b..7b35160c9 100644 --- a/pkg/sass_api/CHANGELOG.md +++ b/pkg/sass_api/CHANGELOG.md @@ -1,7 +1,3 @@ -## 3.1.1 - -* No user-visible changes. - ## 3.1.0 ### Dart API diff --git a/pkg/sass_api/pubspec.yaml b/pkg/sass_api/pubspec.yaml index f7a0b0f5d..ac509de08 100644 --- a/pkg/sass_api/pubspec.yaml +++ b/pkg/sass_api/pubspec.yaml @@ -2,7 +2,7 @@ name: sass_api # Note: Every time we add a new Sass AST node, we need to bump the *major* # version because it's a breaking change for anyone who's implementing the # visitor interface(s). -version: 3.1.1 +version: 3.1.0 description: Additional APIs for Dart Sass. homepage: https://github.com/sass/dart-sass @@ -10,7 +10,7 @@ environment: sdk: ">=2.17.0 <3.0.0" dependencies: - sass: 1.55.1 + sass: 1.55.0 dev_dependencies: dartdoc: ^5.0.0 diff --git a/pubspec.yaml b/pubspec.yaml index 2dbdf0258..e35e11909 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: sass -version: 1.55.1 +version: 1.55.0-dev description: A Sass implementation in Dart. homepage: https://github.com/sass/dart-sass