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

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

Issue 20742002: Clean up error handling. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added documentation guide lines. Created 7 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 part of js_backend; 5 part of js_backend;
6 6
7 /** 7 /**
8 * Assigns JavaScript identifiers to Dart variables, class-names and members. 8 * Assigns JavaScript identifiers to Dart variables, class-names and members.
9 */ 9 */
10 class Namer implements ClosureNamer { 10 class Namer implements ClosureNamer {
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 String get STATIC_CLOSURE_NAME_NAME => r'$name'; 233 String get STATIC_CLOSURE_NAME_NAME => r'$name';
234 SourceString get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME; 234 SourceString get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME;
235 bool get shouldMinify => false; 235 bool get shouldMinify => false;
236 236
237 String getNameForJsGetName(Node node, String name) { 237 String getNameForJsGetName(Node node, String name) {
238 switch (name) { 238 switch (name) {
239 case 'GETTER_PREFIX': return getterPrefix; 239 case 'GETTER_PREFIX': return getterPrefix;
240 case 'SETTER_PREFIX': return setterPrefix; 240 case 'SETTER_PREFIX': return setterPrefix;
241 case 'CALL_CATCH_ALL': return callCatchAllName; 241 case 'CALL_CATCH_ALL': return callCatchAllName;
242 default: 242 default:
243 compiler.reportErrorCode( 243 compiler.reportError(
244 node, MessageKind.GENERIC, 244 node, MessageKind.GENERIC,
245 {'text': 'Error: Namer has no name for "$name".'}); 245 {'text': 'Error: Namer has no name for "$name".'});
246 return 'BROKEN'; 246 return 'BROKEN';
247 } 247 }
248 } 248 }
249 249
250 bool isReserved(String name) => name == isolateName; 250 bool isReserved(String name) => name == isolateName;
251 251
252 String constantName(Constant constant) { 252 String constantName(Constant constant) {
253 // In the current implementation it doesn't make sense to give names to 253 // In the current implementation it doesn't make sense to give names to
(...skipping 1009 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 if (!first) { 1263 if (!first) {
1264 sb.write('_'); 1264 sb.write('_');
1265 } 1265 }
1266 sb.write('_'); 1266 sb.write('_');
1267 visit(link.head); 1267 visit(link.head);
1268 first = true; 1268 first = true;
1269 } 1269 }
1270 } 1270 }
1271 } 1271 }
1272 } 1272 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698