Fix toString for namespaced variable (#1358)

This commit is contained in:
Jennifer Thakar 2021-06-14 14:19:53 -07:00 committed by GitHub
parent f1d36a1860
commit a077094f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

@ -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

View File

@ -23,10 +23,5 @@ class VariableExpression implements Expression {
T accept<T>(ExpressionVisitor<T> 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';
}