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

Unified Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 944423002: Revert "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/namer.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/builder.dart
diff --git a/pkg/compiler/lib/src/ssa/builder.dart b/pkg/compiler/lib/src/ssa/builder.dart
index e3f527f50373789a5900546a1025fa91c849e756..c1d5d55f95748982b51a36bdcc6e7dbdfeea6726 100644
--- a/pkg/compiler/lib/src/ssa/builder.dart
+++ b/pkg/compiler/lib/src/ssa/builder.dart
@@ -3741,20 +3741,16 @@ class SsaBuilder extends ResolvedVisitor {
}
return;
}
- Element element = elements[argument];
- if (element == null ||
- element is! FieldElement ||
- element.enclosingClass != backend.jsGetNameEnum) {
+ ast.LiteralString string = argument.asLiteralString();
+ if (string == null) {
compiler.reportError(
argument, MessageKind.GENERIC,
- {'text': 'Error: Expected a JsGetName enum value.'});
+ {'text': 'Error: Expected a literal string.'});
}
- EnumClassElement enumClass = element.enclosingClass;
- int index = enumClass.enumValues.indexOf(element);
stack.add(
addConstantString(
backend.namer.getNameForJsGetName(
- argument, JsGetName.values[index])));
+ argument, string.dartString.slowToString())));
}
void handleForeignJsEmbeddedGlobal(ast.Send node) {
« no previous file with comments | « pkg/compiler/lib/src/js_backend/namer.dart ('k') | pkg/compiler/lib/src/ssa/ssa.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698