Skip to content

Commit 87ef19a

Browse files
authored
Fix IsCalculationSafe.visitBinaryOperationExpression (#2524)
This was previously checking whether *either* operator was calculation-safe, when in fact it should check that *both* are. Closes #2523
1 parent fae0217 commit 87ef19a

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

CHANGELOG.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
## 1.85.1-dev
1+
## 1.85.1
22

3-
* No user-visible changes.
3+
* Fix a bug where global Sass functions whose names overlap with CSS math
4+
functions could incorrectly be treated as CSS math functions even though they
5+
used Sass-only features, causing compilation failures. For example,
6+
`round(-$var / 2)` previously threw an error but now works as intended.
47

58
## 1.85.0
69

lib/src/visitor/is_calculation_safe.dart

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ class IsCalculationSafeVisitor implements ExpressionVisitor<bool> {
2727
BinaryOperator.plus,
2828
BinaryOperator.minus,
2929
}).contains(node.operator) &&
30-
(node.left.accept(this) || node.right.accept(this));
30+
node.left.accept(this) &&
31+
node.right.accept(this);
3132

3233
bool visitBooleanExpression(BooleanExpression node) => false;
3334

pkg/sass-parser/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 0.4.15-dev
1+
## 0.4.15
22

33
* Add support for parsing list expressions.
44

pkg/sass-parser/package.json

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

pkg/sass_api/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 15.2.1-dev
1+
## 15.2.1
22

33
* No user-visible changes.
44

pkg/sass_api/pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ 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: 15.2.1-dev
5+
version: 15.2.1
66
description: Additional APIs for Dart Sass.
77
homepage: https://github.com/sass/dart-sass
88

pubspec.yaml

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

0 commit comments

Comments
 (0)