Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(642)

Side by Side Diff: pkg/compiler/lib/src/dart_backend/placeholder_collector.dart

Issue 1132783002: Add Accessor, Getter, and Setter elements. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Rebased Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/compiler/lib/src/dart2jslib.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of dart_backend; 5 part of dart_backend;
6 6
7 class LocalPlaceholder { 7 class LocalPlaceholder {
8 final String identifier; 8 final String identifier;
9 final Set<Node> nodes; 9 final Set<Node> nodes;
10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 return; 362 return;
363 } 363 }
364 364
365 ClassElement cls = element.enclosingClass; 365 ClassElement cls = element.enclosingClass;
366 if (cls != null && cls.isEnumClass) { 366 if (cls != null && cls.isEnumClass) {
367 // Enums and enum values cannot be changed, since the semantics of 367 // Enums and enum values cannot be changed, since the semantics of
368 // `toString` is defined by the names of the declarations. 368 // `toString` is defined by the names of the declarations.
369 return; 369 return;
370 } 370 }
371 371
372 if (element.isGetter || element.isSetter) { 372 if (element.isAccessor) {
373 element = (element as FunctionElement).abstractField; 373 element = (element as AccessorElement).abstractField;
374 } 374 }
375 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); 375 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node);
376 } 376 }
377 377
378 /// Marks [node] to be renamed per-library if it names an instance member 378 /// Marks [node] to be renamed per-library if it names an instance member
379 /// and has a private name. 379 /// and has a private name.
380 void tryMakePrivateIdentifier(Node node, Element element) { 380 void tryMakePrivateIdentifier(Node node, Element element) {
381 if (node is Identifier && 381 if (node is Identifier &&
382 !Elements.isStaticOrTopLevel(element) && 382 !Elements.isStaticOrTopLevel(element) &&
383 !Elements.isLocal(element) && 383 !Elements.isLocal(element) &&
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 718
719 visitBlock(Block node) { 719 visitBlock(Block node) {
720 for (Node statement in node.statements.nodes) { 720 for (Node statement in node.statements.nodes) {
721 if (statement is VariableDefinitions) { 721 if (statement is VariableDefinitions) {
722 makeVarDeclarationTypePlaceholder(statement); 722 makeVarDeclarationTypePlaceholder(statement);
723 } 723 }
724 } 724 }
725 node.visitChildren(this); 725 node.visitChildren(this);
726 } 726 }
727 } 727 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/dart2jslib.dart ('k') | pkg/compiler/lib/src/deferred_load.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698