Skip to content

Commit 92fe5ec

Browse files
authored
Fix a crash due to infinite recursion (#194)
1 parent acce840 commit 92fe5ec

File tree

4 files changed

+12
-2
lines changed

4 files changed

+12
-2
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## 1.4.3
2+
3+
### Division Migrator
4+
5+
* Fix a crash when encountering parentheses in an expression that's definitely
6+
not division.
7+
18
## 1.4.2
29

310
### Division Migrator

lib/src/migrators/division.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,9 @@ class _DivisionMigrationVisitor extends MigrationVisitor {
378378

379379
/// Returns true if [node] contains an interpolation.
380380
bool _containsInterpolation(Expression node) {
381-
if (node is ParenthesizedExpression) return _containsInterpolation(node);
381+
if (node is ParenthesizedExpression) {
382+
return _containsInterpolation(node.expression);
383+
}
382384
if (node is BinaryOperationExpression) {
383385
return _containsInterpolation(node.left) ||
384386
_containsInterpolation(node.right);

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: sass_migrator
2-
version: 1.4.2
2+
version: 1.4.3
33
description: A tool for running migrations on Sass files
44
author: Jennifer Thakar <[email protected]>
55
homepage: https://github.com/sass/migrator

test/migrators/division/never_division.hrx

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
e: (bold 6px/3px sans-serif);
77
f: 6 / three;
88
g: rgb(10 20 30 / 0.5);
9+
h: (2 + 3) / text;
910
}
1011

1112
<==> log.txt

0 commit comments

Comments
 (0)