mirror of
https://github.com/danog/dart-sass.git
synced 2025-01-23 06:12:00 +01:00
fix serializing loud comment crash when importing the same file twice in a row (#1713)
* fix serializing loud comment crash when importing the same file twice
This commit is contained in:
parent
44c2966b8a
commit
ae6275e5e2
@ -1,3 +1,8 @@
|
|||||||
|
## 1.52.3
|
||||||
|
|
||||||
|
* Fix crash when trailing loud comments (`/* ... */`) appear twice in a row
|
||||||
|
across two different imports which themselves imported the same file each.
|
||||||
|
|
||||||
## 1.52.2
|
## 1.52.2
|
||||||
|
|
||||||
* Preserve location of trailing loud comments (`/* ... */`) instead of pushing
|
* Preserve location of trailing loud comments (`/* ... */`) instead of pushing
|
||||||
|
@ -1356,6 +1356,11 @@ class _SerializeVisitor
|
|||||||
// simple forward search of the previous.span.text as that might contain
|
// simple forward search of the previous.span.text as that might contain
|
||||||
// other left braces.
|
// other left braces.
|
||||||
var searchFrom = node.span.start.offset - previous.span.start.offset - 1;
|
var searchFrom = node.span.start.offset - previous.span.start.offset - 1;
|
||||||
|
|
||||||
|
// Imports can cause a node to be "contained" by another node when they are
|
||||||
|
// actually the same node twice in a row.
|
||||||
|
if (searchFrom < 0) return false;
|
||||||
|
|
||||||
var endOffset = previous.span.text.lastIndexOf("{", searchFrom);
|
var endOffset = previous.span.text.lastIndexOf("{", searchFrom);
|
||||||
endOffset = math.max(0, endOffset);
|
endOffset = math.max(0, endOffset);
|
||||||
var span = previous.span.file.span(
|
var span = previous.span.file.span(
|
||||||
|
@ -1,3 +1,7 @@
|
|||||||
|
## 1.0.0-beta.48
|
||||||
|
|
||||||
|
* No user-visible changes.
|
||||||
|
|
||||||
## 1.0.0-beta.47
|
## 1.0.0-beta.47
|
||||||
|
|
||||||
* No user-visible changes.
|
* No user-visible changes.
|
||||||
|
@ -2,18 +2,18 @@ name: sass_api
|
|||||||
# Note: Every time we add a new Sass AST node, we need to bump the *major*
|
# 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
|
# version because it's a breaking change for anyone who's implementing the
|
||||||
# visitor interface(s).
|
# visitor interface(s).
|
||||||
version: 1.0.0-beta.47
|
version: 1.0.0-beta.48
|
||||||
description: Additional APIs for Dart Sass.
|
description: Additional APIs for Dart Sass.
|
||||||
homepage: https://github.com/sass/dart-sass
|
homepage: https://github.com/sass/dart-sass
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: ">=2.12.0 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
sass: 1.52.2
|
sass: 1.52.3
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
dartdoc: ^5.0.0
|
dartdoc: ^5.0.0
|
||||||
|
|
||||||
dependency_overrides:
|
dependency_overrides:
|
||||||
sass: {path: ../..}
|
sass: { path: ../.. }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name: sass
|
name: sass
|
||||||
version: 1.52.2
|
version: 1.52.3
|
||||||
description: A Sass implementation in Dart.
|
description: A Sass implementation in Dart.
|
||||||
homepage: https://github.com/sass/dart-sass
|
homepage: https://github.com/sass/dart-sass
|
||||||
|
|
||||||
@ -8,7 +8,7 @@ executables:
|
|||||||
sass: sass
|
sass: sass
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=2.12.0 <3.0.0'
|
sdk: ">=2.12.0 <3.0.0"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
args: ^2.0.0
|
args: ^2.0.0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user