| Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart
|
| diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
|
| index b6318b8a27a610c9b284958d94d1cbffe5b0fa0d..84a5e5b2160e479d25d8be15f549f9eefd3ea5dd 100644
|
| --- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
|
| +++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
|
| @@ -175,6 +175,15 @@ class PlaceholderCollector extends AbstractVisitor {
|
| internalError('Unreachable case');
|
| }
|
| }
|
| + } else if (element.isTopLevel()) {
|
| + Node fieldNode = element.parseNode(compiler);
|
| + if (fieldNode is Identifier) {
|
| + makeElementPlaceholder(fieldNode, element);
|
| + } else if (fieldNode is SendSet) {
|
| + makeElementPlaceholder(fieldNode.selector, element);
|
| + } else {
|
| + internalError('Unreachable case');
|
| + }
|
| }
|
| }
|
|
|
| @@ -190,6 +199,8 @@ class PlaceholderCollector extends AbstractVisitor {
|
| // variable list element twice, better merge this with emitter logic.
|
| currentElement = (element as VariableElement).variables;
|
| elementNode = currentElement.parseNode(compiler);
|
| + // We don't collect other elements from the same variable lists
|
| + // if they are not used. http://dartbug.com/4536
|
| collectFieldDeclarationPlaceholders(element, elementNode);
|
| } else if (element is ClassElement || element is TypedefElement) {
|
| currentElement = element;
|
|
|