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

Unified Diff: pkg/compiler/lib/src/js_emitter/new_emitter/emitter.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/new_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
index 1cea1f35828bdfd5bcdf709d34ca9219ce664739..d3425bf7acabe866ad7ff17c1f3db0717718ff95 100644
--- a/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/new_emitter/emitter.dart
@@ -76,10 +76,9 @@ class Emitter implements emitterTask.Emitter {
}
js.PropertyAccess _globalPropertyAccess(Element element) {
- String name = namer.globalPropertyName(element);
- js.PropertyAccess pa = new js.PropertyAccess.field(
- new js.VariableUse(namer.globalObjectFor(element)),
- name);
+ js.Name name = namer.globalPropertyName(element);
+ js.PropertyAccess pa = new js.PropertyAccess(
+ new js.VariableUse(namer.globalObjectFor(element)), name);
return pa;
}
@@ -163,23 +162,8 @@ class Emitter implements emitterTask.Emitter {
String isPrefix = namer.operatorIsPrefix;
return js.js.expressionTemplateFor("('$isPrefix' + #) in #.prototype");
- case JsBuiltin.isFunctionTypeRti:
- String functionClassName =
- _backend.namer.runtimeTypeName(_compiler.functionClass);
- return js.js.expressionTemplateFor(
- '#.$typeNameProperty === "$functionClassName"');
-
- case JsBuiltin.isNullTypeRti:
- String nullClassName =
- _backend.namer.runtimeTypeName(_compiler.nullClass);
- return js.js.expressionTemplateFor(
- '#.$typeNameProperty === "$nullClassName"');
-
- case JsBuiltin.isDartObjectTypeRti:
- String dartObjectClassName =
- _backend.namer.runtimeTypeName(_compiler.objectClass);
- return js.js.expressionTemplateFor(
- '#.$typeNameProperty === "$dartObjectClassName"');
+ case JsBuiltin.isGivenTypeRti:
+ return js.js.expressionTemplateFor('#.$typeNameProperty === #');
case JsBuiltin.getMetadata:
return _emitter.templateForReadMetadata;

Powered by Google App Engine
This is Rietveld 408576698