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

Side by Side Diff: frog/leg/namer.dart

Issue 9223012: Small changes to get code generation of getters and setters working. Resolution is not fully corr... (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 | « frog/leg/emitter.dart ('k') | frog/leg/resolver.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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 /** 5 /**
6 * Assigns JavaScript identifiers to Dart variables, class-names and members. 6 * Assigns JavaScript identifiers to Dart variables, class-names and members.
7 */ 7 */
8 class Namer { 8 class Namer {
9 final Compiler compiler; 9 final Compiler compiler;
10 10
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 if (element.isInstanceMember()) { 100 if (element.isInstanceMember()) {
101 SourceString name; 101 SourceString name;
102 if (element.kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY) { 102 if (element.kind == ElementKind.GENERATIVE_CONSTRUCTOR_BODY) {
103 ConstructorBodyElement bodyElement = element; 103 ConstructorBodyElement bodyElement = element;
104 SourceString name = getConstructorName(bodyElement.constructor); 104 SourceString name = getConstructorName(bodyElement.constructor);
105 return instanceMethodName(name, bodyElement.parameterCount(compiler)); 105 return instanceMethodName(name, bodyElement.parameterCount(compiler));
106 } else if (element.kind == ElementKind.FUNCTION) { 106 } else if (element.kind == ElementKind.FUNCTION) {
107 FunctionElement functionElement = element; 107 FunctionElement functionElement = element;
108 int parameterCount = functionElement.parameterCount(compiler); 108 int parameterCount = functionElement.parameterCount(compiler);
109 return instanceMethodName(element.name, parameterCount); 109 return instanceMethodName(element.name, parameterCount);
110 } else if (element.kind == ElementKind.GETTER) {
111 return getterName(element.name);
112 } else if (element.kind == ElementKind.SETTER) {
113 return setterName(element.name);
110 } else { 114 } else {
111 return instanceFieldName(element.name); 115 return instanceFieldName(element.name);
112 } 116 }
113 } else { 117 } else {
114 // Dealing with a top-level or static element. 118 // Dealing with a top-level or static element.
115 String cached = globals[element]; 119 String cached = globals[element];
116 if (cached !== null) return cached; 120 if (cached !== null) return cached;
117 121
118 String guess = _computeGuess(element); 122 String guess = _computeGuess(element);
119 switch (element.kind) { 123 switch (element.kind) {
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 } 170 }
167 171
168 String isolateBailoutAccess(Element element) { 172 String isolateBailoutAccess(Element element) {
169 return '${isolateAccess(element)}\$bailout'; 173 return '${isolateAccess(element)}\$bailout';
170 } 174 }
171 175
172 String operatorIs(ClassElement element) { 176 String operatorIs(ClassElement element) {
173 return 'is\$${getName(element)}'; 177 return 'is\$${getName(element)}';
174 } 178 }
175 } 179 }
OLDNEW
« no previous file with comments | « frog/leg/emitter.dart ('k') | frog/leg/resolver.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698