Skip to content

Commit 7c4f384

Browse files
ntkmenex3
andauthored
Fix simplifying SassCalculation with unsimplifiable CalculationOperation (#2735)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
1 parent f5ad3f6 commit 7c4f384

File tree

7 files changed

+21
-5
lines changed

7 files changed

+21
-5
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.97.4-dev
2+
3+
### JavaScript API
4+
5+
* Fix a crash when manually constructing a `SassCalculation` for `'calc'` with
6+
an argument that can't be simplified.
7+
18
## 1.97.3
29

310
* Fix a bug where nesting an at-rule within multiple style rules in plain CSS

lib/src/js/compile.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,8 @@ Value _simplifyValue(Value value) => switch (value) {
388388
.map(_simplifyCalcArg)
389389
.toList(),
390390
)) {
391-
('calc', [var first]) => first as Value,
391+
('calc', [Value first]) => first,
392+
('calc', [var first]) => SassCalculation.calc(first),
392393
('calc', _) =>
393394
throw ArgumentError('calc() requires exactly one argument.'),
394395
('clamp', [var min, var value, var max]) => SassCalculation.clamp(

pkg/sass-parser/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.4.43-dev
2+
3+
* No user-visible changes.
4+
15
## 0.4.42
26

37
* No user-visible changes.

pkg/sass-parser/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sass-parser",
3-
"version": "0.4.42",
3+
"version": "0.4.43-dev",
44
"description": "A PostCSS-compatible wrapper of the official Sass parser",
55
"repository": "sass/dart-sass",
66
"author": "Google Inc.",

pkg/sass_api/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 17.3.4-dev
2+
3+
* No user-visible changes.
4+
15
## 17.3.3
26

37
* No user-visible changes.

pkg/sass_api/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ name: sass_api
22
# Note: Every time we add a new Sass AST node, we need to bump the *major*
33
# version because it's a breaking change for anyone who's implementing the
44
# visitor interface(s).
5-
version: 17.3.3
5+
version: 17.3.4-dev
66
description: Additional APIs for Dart Sass.
77
homepage: https://github.com/sass/dart-sass
88

99
environment:
1010
sdk: ">=3.6.0 <4.0.0"
1111

1212
dependencies:
13-
sass: 1.97.3
13+
sass: 1.97.4
1414

1515
dev_dependencies:
1616
dartdoc: ">=8.0.14 <10.0.0"

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass
2-
version: 1.97.3
2+
version: 1.97.4-dev
33
description: A Sass implementation in Dart.
44
homepage: https://github.com/sass/dart-sass
55

0 commit comments

Comments
 (0)