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

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

Issue 10876008: Remove most superfluous getter arguments from dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 4 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 /** 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
11 static Set<String> _jsReserved = null; 11 static Set<String> _jsReserved = null;
12 Set<String> get jsReserved() { 12 Set<String> get jsReserved {
13 if (_jsReserved === null) { 13 if (_jsReserved === null) {
14 _jsReserved = new Set<String>(); 14 _jsReserved = new Set<String>();
15 _jsReserved.addAll(JsNames.javaScriptKeywords); 15 _jsReserved.addAll(JsNames.javaScriptKeywords);
16 _jsReserved.addAll(JsNames.reservedPropertySymbols); 16 _jsReserved.addAll(JsNames.reservedPropertySymbols);
17 } 17 }
18 return _jsReserved; 18 return _jsReserved;
19 } 19 }
20 20
21 Map<Element, String> globals; 21 Map<Element, String> globals;
22 Map<String, int> usedGlobals; 22 Map<String, int> usedGlobals;
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
292 } 292 }
293 293
294 String safeName(String name) { 294 String safeName(String name) {
295 if (jsReserved.contains(name) || name.startsWith('\$')) { 295 if (jsReserved.contains(name) || name.startsWith('\$')) {
296 name = "\$$name"; 296 name = "\$$name";
297 assert(!jsReserved.contains(name)); 297 assert(!jsReserved.contains(name));
298 } 298 }
299 return name; 299 return name;
300 } 300 }
301 } 301 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/lib/isolate_patch.dart ('k') | dart/lib/compiler/implementation/patch_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698