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

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

Issue 255843005: Avoid generating VariableUse nodes with non-identifier names (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
Index: sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
index 7a33d97692815cf9fa685560c7dac7eac3a63bf4..abca0c595d3cdab42639eb50249eb672c42d057e 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/namer.dart
@@ -895,12 +895,21 @@ class Namer implements ClosureNamer {
return "${globalObjectFor(element)}.${getNameX(element)}";
}
- String isolateLazyInitializerAccess(Element element) {
- return "${globalObjectFor(element)}.${getLazyInitializerName(element)}";
+ jsAst.Expression isolateLazyInitializerAccess(Element element) {
+ return js('#.#',
+ [globalObjectFor(element), getLazyInitializerName(element)]);
}
- String isolateStaticClosureAccess(Element element) {
- return "${globalObjectFor(element)}.${getStaticClosureName(element)}()";
+ jsAst.Expression isolateStaticClosureAccess(Element element) {
+ return js('#.#()',
+ [globalObjectFor(element), getStaticClosureName(element)]);
+ }
+
+ // This name is used as part of the name of a TypeConstant
+ String uniqueNameForTypeConstantElement(Element element) {
+ // TODO(sra): If we replace the period with an identifier character,
+ // TypeConstants will have better names in unminified code.
+ return "${globalObjectFor(element)}.${getNameX(element)}";
}
String globalObjectForConstant(Constant constant) => 'C';
@@ -1178,7 +1187,7 @@ class ConstantNamingVisitor implements ConstantVisitor {
addRoot('Type');
DartType type = constant.representedType;
JavaScriptBackend backend = compiler.backend;
- String name = backend.rti.getRawTypeRepresentation(type);
+ String name = backend.rti.getTypeRepresentationForTypeConstant(type);
addIdentifier(name);
}
@@ -1258,7 +1267,7 @@ class ConstantCanonicalHasher implements ConstantVisitor<int> {
int visitType(TypeConstant constant) {
DartType type = constant.representedType;
JavaScriptBackend backend = compiler.backend;
- String name = backend.rti.getRawTypeRepresentation(type);
+ String name = backend.rti.getTypeRepresentationForTypeConstant(type);
return _hashString(4, name);
}

Powered by Google App Engine
This is Rietveld 408576698