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

Unified Diff: pkg/compiler/lib/src/js_backend/runtime_types.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_backend/runtime_types.dart
diff --git a/pkg/compiler/lib/src/js_backend/runtime_types.dart b/pkg/compiler/lib/src/js_backend/runtime_types.dart
index 2b13f034dad8861b1e94fa3daf4a0b887d1fd2b4..66be56ad3d5d1d52701f4003028637dca97edb14 100644
--- a/pkg/compiler/lib/src/js_backend/runtime_types.dart
+++ b/pkg/compiler/lib/src/js_backend/runtime_types.dart
@@ -32,7 +32,7 @@ class RuntimeTypes {
JavaScriptBackend get backend => compiler.backend;
- String get getFunctionThatReturnsNullName
+ jsAst.Name get getFunctionThatReturnsNullName
=> backend.namer.internalGlobal('functionThatReturnsNull');
RuntimeTypes(Compiler compiler)
@@ -401,7 +401,7 @@ class RuntimeTypes {
String getTypeRepresentationForTypeConstant(DartType type) {
JavaScriptBackend backend = compiler.backend;
Namer namer = backend.namer;
- if (type.isDynamic) return namer.runtimeTypeName(null);
+ if (type.isDynamic) return "dynamic";
String name = namer.uniqueNameForTypeConstantElement(type.element);
if (!type.element.isClass) return name;
InterfaceType interface = type;
@@ -541,10 +541,10 @@ class RuntimeTypes {
getTypeEncoding(type, alwaysGenerateFunction: true);
if (contextClass != null) {
JavaScriptBackend backend = compiler.backend;
- String contextName = backend.namer.className(contextClass);
+ jsAst.Name contextName = backend.namer.className(contextClass);
return js('function () { return #(#, #, #); }',
[ backend.emitter.staticFunctionAccess(backend.getComputeSignature()),
- encoding, this_, js.string(contextName) ]);
+ encoding, this_, js.quoteName(contextName) ]);
} else {
return encoding;
}

Powered by Google App Engine
This is Rietveld 408576698