Chromium Code Reviews| Index: lib/compiler/implementation/dart_backend/emitter.dart |
| diff --git a/lib/compiler/implementation/dart_backend/emitter.dart b/lib/compiler/implementation/dart_backend/emitter.dart |
| index 58d2b6aac991f55c37bdf8d44b6bc8794ab47187..f5264e6f097900918c2fdbc1b604f13ceb4e7014 100644 |
| --- a/lib/compiler/implementation/dart_backend/emitter.dart |
| +++ b/lib/compiler/implementation/dart_backend/emitter.dart |
| @@ -10,11 +10,13 @@ class Emitter { |
| final Compiler compiler; |
| final StringBuffer sb; |
| final ConflictingRenamer renamer; |
| + final Set<VariableListElement> processedVariableLists; |
| Emitter(Compiler compiler) : |
| this.compiler = compiler, |
| sb = new StringBuffer(), |
| - renamer = new ConflictingRenamer(compiler); |
| + renamer = new ConflictingRenamer(compiler), |
| + processedVariableLists = new Set<VariableListElement>(); |
| /** |
| * Outputs given class element with selected inner elements. |
| @@ -66,7 +68,13 @@ class Emitter { |
| || element is AbstractFieldElement) return; |
| if (element.isField()) { |
| assert(element is VariableElement); |
| - sb.add(unparser.unparse(element.variables.parseNode(compiler))); |
| + // Different VariableElement's may refer to the same VariableListElement. |
| + // Output this list only once. |
| + final variableList = element.variables; |
| + if (!processedVariableLists.contains(variableList)) { |
|
Roman
2012/07/31 18:45:03
Hmm, I just thought about it in another way - we o
Anton Muhin
2012/07/31 18:55:37
Good point, todo added.
On 2012/07/31 18:45:03, R
|
| + processedVariableLists.add(variableList); |
| + sb.add(unparser.unparse(variableList.parseNode(compiler))); |
| + } |
| } else { |
| sb.add(unparser.unparse(element.parseNode(compiler))); |
| } |