From a077094f24e56263435a9b8fa7f91360389b742d Mon Sep 17 00:00:00 2001 From: Jennifer Thakar Date: Mon, 14 Jun 2021 14:19:53 -0700 Subject: [PATCH] Fix toString for namespaced variable (#1358) --- CHANGELOG.md | 3 +++ lib/src/ast/sass/expression/variable.dart | 7 +------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3b4780cb0..2113d67d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,9 @@ * Fix a couple bugs that could prevent some members from being found in certain files that use a mix of imports and the module system. +* Fix incorrect recommendation for migrating division expressions that reference + namespaced variables. + ## 1.34.1 * Fix a bug where `--update` would always compile any file that depends on a diff --git a/lib/src/ast/sass/expression/variable.dart b/lib/src/ast/sass/expression/variable.dart index 7cb5357e9..303d9d894 100644 --- a/lib/src/ast/sass/expression/variable.dart +++ b/lib/src/ast/sass/expression/variable.dart @@ -23,10 +23,5 @@ class VariableExpression implements Expression { T accept(ExpressionVisitor visitor) => visitor.visitVariableExpression(this); - String toString() { - var buffer = StringBuffer("\$"); - if (namespace != null) buffer.write("$namespace."); - buffer.write(name); - return buffer.toString(); - } + String toString() => namespace == null ? '\$$name' : '$namespace.\$$name'; }