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: dart/lib/compiler/implementation/js_backend/namer.dart

Issue 11233061: Revert "Parts must start with 'part of'" and "Attempt to fix VM build" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
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 part of js_backend;
6
7 /** 5 /**
8 * Assigns JavaScript identifiers to Dart variables, class-names and members. 6 * Assigns JavaScript identifiers to Dart variables, class-names and members.
9 */ 7 */
10 class Namer { 8 class Namer {
11 final Compiler compiler; 9 final Compiler compiler;
12 10
13 static Set<String> _jsReserved = null; 11 static Set<String> _jsReserved = null;
14 Set<String> get jsReserved { 12 Set<String> get jsReserved {
15 if (_jsReserved == null) { 13 if (_jsReserved == null) {
16 _jsReserved = new Set<String>(); 14 _jsReserved = new Set<String>();
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 } 322 }
325 323
326 String safeName(String name) { 324 String safeName(String name) {
327 if (jsReserved.contains(name) || name.startsWith('\$')) { 325 if (jsReserved.contains(name) || name.startsWith('\$')) {
328 name = "\$$name"; 326 name = "\$$name";
329 assert(!jsReserved.contains(name)); 327 assert(!jsReserved.contains(name));
330 } 328 }
331 return name; 329 return name;
332 } 330 }
333 } 331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698