Skip to content

Commit 37e0ed5

Browse files
ntkmenex3
andauthoredSep 15, 2023
Fix source span for calculation deprecation warnings (#2084)
Co-authored-by: Natalie Weizenbaum <nweiz@google.com>
1 parent 7370d6a commit 37e0ed5

File tree

4 files changed

+16
-2
lines changed

4 files changed

+16
-2
lines changed
 

‎CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.67.1
2+
3+
* Fix the source spans associated with the `abs-percent` deprecation.
4+
15
## 1.67.0
26

37
* All functions defined in CSS Values and Units 4 are now once again parsed as

‎lib/src/visitor/async_evaluate.dart

+5
Original file line numberDiff line numberDiff line change
@@ -2431,6 +2431,9 @@ final class _EvaluateVisitor
24312431
return SassCalculation.unsimplified(node.name, arguments);
24322432
}
24332433

2434+
var oldCallableNode = _callableNode;
2435+
_callableNode = node;
2436+
24342437
try {
24352438
return switch (node.name.toLowerCase()) {
24362439
"calc" => SassCalculation.calc(arguments[0]),
@@ -2471,6 +2474,8 @@ final class _EvaluateVisitor
24712474
_verifyCompatibleNumbers(arguments, node.arguments.positional);
24722475
}
24732476
throwWithTrace(_exception(error.message, node.span), error, stackTrace);
2477+
} finally {
2478+
_callableNode = oldCallableNode;
24742479
}
24752480
}
24762481

‎lib/src/visitor/evaluate.dart

+6-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// DO NOT EDIT. This file was generated from async_evaluate.dart.
66
// See tool/grind/synchronize.dart for details.
77
//
8-
// Checksum: ccd4ec1a65cfc2487fccd30481d427086f5c76cc
8+
// Checksum: 7669de19668af665d1a9a60cf67e53e071bf415e
99
//
1010
// ignore_for_file: unused_import
1111

@@ -2411,6 +2411,9 @@ final class _EvaluateVisitor
24112411
return SassCalculation.unsimplified(node.name, arguments);
24122412
}
24132413

2414+
var oldCallableNode = _callableNode;
2415+
_callableNode = node;
2416+
24142417
try {
24152418
return switch (node.name.toLowerCase()) {
24162419
"calc" => SassCalculation.calc(arguments[0]),
@@ -2451,6 +2454,8 @@ final class _EvaluateVisitor
24512454
_verifyCompatibleNumbers(arguments, node.arguments.positional);
24522455
}
24532456
throwWithTrace(_exception(error.message, node.span), error, stackTrace);
2457+
} finally {
2458+
_callableNode = oldCallableNode;
24542459
}
24552460
}
24562461

‎pubspec.yaml

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

0 commit comments

Comments
 (0)
Please sign in to comment.