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

Unified Diff: pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart

Issue 1198293002: dart2js: Use an abstract Name class for names in the generated JavaScript ast. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fix tests Created 5 years, 6 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: pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
diff --git a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
index ca21f2e72b1ffe0f59194a56d89e75c5e0b142e9..52c43524e04282b8b57ee36d64793c0bb1b08db9 100644
--- a/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
+++ b/pkg/compiler/lib/src/js_emitter/runtime_type_generator.dart
@@ -17,7 +17,7 @@ class TypeTestProperties {
/// The properties that must be installed on the prototype of the
/// JS constructor of the [ClassElement] for which the is checks were
/// generated.
- final Map<String, jsAst.Node> properties = <String, jsAst.Node>{};
+ final Map<jsAst.Name, jsAst.Node> properties = <jsAst.Name, jsAst.Node>{};
}
class RuntimeTypeGenerator {
@@ -79,7 +79,7 @@ class RuntimeTypeGenerator {
ClosureFieldElement thisLocal =
closureData.freeVariableMap[closureData.thisLocal];
if (thisLocal != null) {
- String thisName = namer.instanceFieldPropertyName(thisLocal);
+ jsAst.Name thisName = namer.instanceFieldPropertyName(thisLocal);
thisAccess = js('this.#', thisName);
}
}
@@ -90,7 +90,8 @@ class RuntimeTypeGenerator {
} else {
RuntimeTypes rti = backend.rti;
jsAst.Expression encoding = rti.getSignatureEncoding(type, thisAccess);
- String operatorSignature = namer.operatorSignature;
+ jsAst.Name operatorSignature =
+ namer.asName(namer.operatorSignature);
result.properties[operatorSignature] = encoding;
}
}
@@ -283,7 +284,7 @@ class RuntimeTypeGenerator {
StubMethod _generateTypeVariableReader(ClassElement cls,
TypeVariableElement element) {
- String name = namer.nameForReadTypeVariable(element);
+ jsAst.Name name = namer.nameForReadTypeVariable(element);
int index = RuntimeTypes.getTypeVariableIndex(element);
jsAst.Expression computeTypeVariable;

Powered by Google App Engine
This is Rietveld 408576698