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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.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/runtime_types.dart
diff --git a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
index 1b26dc04087466e5ee5d4ed71e3d354aa4decb78..76d0b4068d94bb6063cfbb2ac660fda0060c9171 100644
--- a/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
+++ b/sdk/lib/_internal/compiler/implementation/js_backend/runtime_types.dart
@@ -401,18 +401,18 @@ class RuntimeTypes {
..addAll(checkedArguments);
}
- /// Return the unique name for the element as an unquoted string.
- String getJsName(Element element) {
+ String getTypeRepresentationForTypeConstant(DartType type) {
JavaScriptBackend backend = compiler.backend;
Namer namer = backend.namer;
- return namer.isolateAccess(element);
- }
-
- String getRawTypeRepresentation(DartType type) {
- String name = getJsName(type.element);
+ String name = namer.uniqueNameForTypeConstantElement(type.element);
if (!type.element.isClass()) return name;
InterfaceType interface = type;
Link<DartType> variables = interface.element.typeVariables;
+ // Type constants can currently only be raw types, so there is no point
+ // adding ground-term type parameters, as they would just be 'dynamic'.
+ // TODO(sra): Since the result string is used only in constructing constant
+ // names, it would result in more readable names if the final string was a
+ // legal JavaScript identifer.
if (variables.isEmpty) return name;
String arguments =
new List.filled(variables.slowLength(), 'dynamic').join(', ');

Powered by Google App Engine
This is Rietveld 408576698