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

Side by Side Diff: frog/var_member.dart

Issue 8915021: Code review changes (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: comment Created 9 years 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/member.dart ('k') | no next file » | 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 /** A dynamic member stub. */ 5 /** A dynamic member stub. */
6 class VarMember { 6 class VarMember {
7 final String name; 7 final String name;
8 bool isGenerated = false; 8 bool isGenerated = false;
9 9
10 VarMember(this.name); 10 VarMember(this.name);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 world.objectType.varStubs[stub.name] = stub; 238 world.objectType.varStubs[stub.name] = stub;
239 } 239 }
240 } 240 }
241 241
242 // TODO(jmesserly): get rid of this as it's unused now 242 // TODO(jmesserly): get rid of this as it's unused now
243 void generate(CodeWriter code) {} 243 void generate(CodeWriter code) {}
244 } 244 }
245 245
246 String _getCallStubName(String name, Arguments args) { 246 String _getCallStubName(String name, Arguments args) {
247 // TODO: This code needs global knowledge to ensure the stub name does not 247 // TODO: This code needs global knowledge to ensure the stub name does not
248 // collide with any other name. 248 // collide with any other name. E.g. it is unlikely but possible for the user
249 // to have methods called 'foo' and 'foo$0'.
Jennifer Messerly 2011/12/14 22:07:08 if the user had a method called foo$0, it would ge
249 final nameBuilder = new StringBuffer('${name}\$${args.bareCount}'); 250 final nameBuilder = new StringBuffer('${name}\$${args.bareCount}');
250 for (int i = args.bareCount; i < args.length; i++) { 251 for (int i = args.bareCount; i < args.length; i++) {
251 var name = args.getName(i); 252 var name = args.getName(i);
252 nameBuilder.add('\$'); 253 nameBuilder.add('\$');
253 if (name.contains('\$')) { 254 if (name.contains('\$')) {
254 // Disambiguate "a:b:" from "a$b:" 255 // Disambiguate "a:b:" from "a$b:". Using the length works well because
256 // the names can't start with digits.
255 nameBuilder.add('${name.length}'); 257 nameBuilder.add('${name.length}');
256 } 258 }
257 nameBuilder.add(name); 259 nameBuilder.add(name);
258 } 260 }
259 return nameBuilder.toString(); 261 return nameBuilder.toString();
260 } 262 }
OLDNEW
« no previous file with comments | « frog/member.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698