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

Side by Side Diff: lib/compiler/implementation/ssa/js_names.dart

Issue 10880068: - Change "static final" to "static const" in the lib/ directory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 class JsNames { 5 class JsNames {
6 static final javaScriptKeywords = const <String>[ 6 static const javaScriptKeywords = const <String>[
7 // These are current keywords 7 // These are current keywords
8 "break", "delete", "function", "return", "typeof", "case", "do", "if", 8 "break", "delete", "function", "return", "typeof", "case", "do", "if",
9 "switch", "var", "catch", "else", "in", "this", "void", "continue", 9 "switch", "var", "catch", "else", "in", "this", "void", "continue",
10 "false", "instanceof", "throw", "while", "debugger", "finally", "new", 10 "false", "instanceof", "throw", "while", "debugger", "finally", "new",
11 "true", "with", "default", "for", "null", "try", 11 "true", "with", "default", "for", "null", "try",
12 12
13 // These are future keywords 13 // These are future keywords
14 "abstract", "double", "goto", "native", "static", "boolean", "enum", 14 "abstract", "double", "goto", "native", "static", "boolean", "enum",
15 "implements", "package", "super", "byte", "export", "import", "private", 15 "implements", "package", "super", "byte", "export", "import", "private",
16 "synchronized", "char", "extends", "int", "protected", "throws", 16 "synchronized", "char", "extends", "int", "protected", "throws",
17 "class", "final", "interface", "public", "transient", "const", "float", 17 "class", "final", "interface", "public", "transient", "const", "float",
18 "long", "short", "volatile" 18 "long", "short", "volatile"
19 ]; 19 ];
20 20
21 static final reservedGlobalSymbols = const <String>[ 21 static const reservedGlobalSymbols = const <String>[
22 // Section references are from Ecma-262 22 // Section references are from Ecma-262
23 // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pd f) 23 // (http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pd f)
24 24
25 // 15.1.1 Value Properties of the Global Object 25 // 15.1.1 Value Properties of the Global Object
26 "NaN", "Infinity", "undefined", 26 "NaN", "Infinity", "undefined",
27 27
28 // 15.1.2 Function Properties of the Global Object 28 // 15.1.2 Function Properties of the Global Object
29 "eval", "parseInt", "parseFloat", "isNan", "isFinite", 29 "eval", "parseInt", "parseFloat", "isNan", "isFinite",
30 30
31 // 15.1.3 URI Handling Function Properties 31 // 15.1.3 URI Handling Function Properties
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 "\$wnd", "\$doc", "\$entry", "\$moduleName", "\$moduleBase", 143 "\$wnd", "\$doc", "\$entry", "\$moduleName", "\$moduleBase",
144 "\$gwt_version", "\$sessionId", 144 "\$gwt_version", "\$sessionId",
145 145
146 // Identifiers used by JsStackEmulator; later set to obfuscatable 146 // Identifiers used by JsStackEmulator; later set to obfuscatable
147 "\$stack", "\$stackDepth", "\$location", 147 "\$stack", "\$stackDepth", "\$location",
148 148
149 // TODO: prove why this is necessary or remove it 149 // TODO: prove why this is necessary or remove it
150 "call" 150 "call"
151 ]; 151 ];
152 152
153 static final reservedPropertySymbols = 153 static const reservedPropertySymbols =
154 const <String>["__PROTO__", "prototype", "constructor"]; 154 const <String>["__PROTO__", "prototype", "constructor"];
155 155
156 static Set<String> _reserved; 156 static Set<String> _reserved;
157 157
158 static Set<String> get reserved { 158 static Set<String> get reserved {
159 if (_reserved === null) { 159 if (_reserved === null) {
160 _reserved = new Set<String>(); 160 _reserved = new Set<String>();
161 _reserved.addAll(reservedPropertySymbols); 161 _reserved.addAll(reservedPropertySymbols);
162 _reserved.addAll(reservedGlobalSymbols); 162 _reserved.addAll(reservedGlobalSymbols);
163 _reserved.addAll(javaScriptKeywords); 163 _reserved.addAll(javaScriptKeywords);
(...skipping 10 matching lines...) Expand all
174 static String getValid(String name) { 174 static String getValid(String name) {
175 if (reserved.contains(name)) { 175 if (reserved.contains(name)) {
176 name = '$name\$'; 176 name = '$name\$';
177 assert(!reserved.contains(name)); 177 assert(!reserved.contains(name));
178 } else if (name.contains(@'$')) { 178 } else if (name.contains(@'$')) {
179 name = name.replaceAll(@'$', @'$$'); 179 name = name.replaceAll(@'$', @'$$');
180 } 180 }
181 return name; 181 return name;
182 } 182 }
183 } 183 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/ssa/codegen.dart ('k') | lib/compiler/implementation/ssa/nodes.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698