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

Unified Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 929313002: Use an enum in embedded_names as input to JS_GET_NAME. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 8df84a562f0979f1430950e40e5191493520f089..edebd0002ecc8a097ea1299d718783ac0e32ac56 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -301,22 +301,24 @@ class Namer implements ClosureNamer {
String get closureInvocationSelectorName => Compiler.CALL_OPERATOR_NAME;
bool get shouldMinify => false;
- String getNameForJsGetName(Node node, String name) {
+ /// Returns the string that is to be used as the result of a call to
+ /// [JS_GET_NAME] at [node] with argument [name].
+ String getNameForJsGetName(Node node, JsGetName name) {
switch (name) {
- case 'GETTER_PREFIX': return getterPrefix;
- case 'SETTER_PREFIX': return setterPrefix;
- case 'CALL_PREFIX': return callPrefix;
- case 'CALL_CATCH_ALL': return callCatchAllName;
- case 'REFLECTABLE': return reflectableField;
- case 'CLASS_DESCRIPTOR_PROPERTY': return classDescriptorProperty;
- case 'REQUIRED_PARAMETER_PROPERTY': return requiredParameterField;
- case 'DEFAULT_VALUES_PROPERTY': return defaultValuesField;
- case 'CALL_NAME_PROPERTY': return callNameField;
+ case JsGetName.GETTER_PREFIX: return getterPrefix;
+ case JsGetName.SETTER_PREFIX: return setterPrefix;
+ case JsGetName.CALL_PREFIX: return callPrefix;
+ case JsGetName.CALL_CATCH_ALL: return callCatchAllName;
+ case JsGetName.REFLECTABLE: return reflectableField;
+ case JsGetName.CLASS_DESCRIPTOR_PROPERTY:
+ return classDescriptorProperty;
+ case JsGetName.REQUIRED_PARAMETER_PROPERTY:
+ return requiredParameterField;
+ case JsGetName.DEFAULT_VALUES_PROPERTY: return defaultValuesField;
+ case JsGetName.CALL_NAME_PROPERTY: return callNameField;
default:
- compiler.reportError(
- node, MessageKind.GENERIC,
- {'text': 'Error: Namer has no name for "$name".'});
- return 'BROKEN';
+ assert(invariant(node, "Missing JsGetName value in namer!"));
floitsch 2015/02/18 13:00:44 Keep the 'compiler.reportError'.
herhut 2015/02/19 10:27:28 Done.
+ return null;
}
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/js_backend.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698