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

Side by Side Diff: lib/compiler/implementation/js_backend/namer.dart

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

Powered by Google App Engine
This is Rietveld 408576698