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

Unified Diff: pkg/compiler/lib/src/js_backend/codegen/codegen.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 new emitter. 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/codegen/codegen.dart
diff --git a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
index 0e7f886e1fc01d176db999cf028411bee2f2da84..edda573343883f8ffe9efffe8bfbf797699596d8 100644
--- a/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
+++ b/pkg/compiler/lib/src/js_backend/codegen/codegen.dart
@@ -234,7 +234,8 @@ class CodeGenerator extends tree_ir.StatementVisitor
// [Entity]s or add a specialized Tree-IR node for interceptor calls.
registry.registerUseInterceptor();
js.VariableUse interceptorLibrary = glue.getInterceptorLibrary();
- return js.propertyCall(interceptorLibrary, selector.name, arguments);
+ return js.propertyCall(interceptorLibrary, js.string(selector.name),
floitsch 2015/06/22 17:43:43 why is this just a string?
herhut 2015/06/23 13:26:30 Because it is a broken abstraction. Selectors can
asgerf 2015/06/23 13:34:54 Yeah that was broken. This CL should fix it: http
+ arguments);
} else {
js.Expression elementAccess = glue.staticFunctionAccess(target);
return new js.Call(elementAccess, arguments,
@@ -376,14 +377,14 @@ class CodeGenerator extends tree_ir.StatementVisitor
? glue.getCheckSubtype()
: glue.getSubtypeCast();
- js.Expression isT = js.string(glue.getTypeTestTag(type));
+ js.Expression isT = js.quoteName(glue.getTypeTestTag(type));
js.Expression typeArgumentArray = typeArguments.isNotEmpty
? new js.ArrayInitializer(typeArguments)
: new js.LiteralNull();
js.Expression asT = glue.hasStrictSubtype(clazz)
- ? js.string(glue.getTypeSubstitutionTag(clazz))
+ ? js.quoteName(glue.getTypeSubstitutionTag(clazz))
: new js.LiteralNull();
return buildStaticHelperInvocation(
@@ -610,7 +611,8 @@ class CodeGenerator extends tree_ir.StatementVisitor
js.Expression visitCreateInvocationMirror(
tree_ir.CreateInvocationMirror node) {
js.Expression name = js.string(node.selector.name);
- js.Expression internalName = js.string(glue.invocationName(node.selector));
+ js.Expression internalName =
+ js.quoteName(glue.invocationName(node.selector));
js.Expression kind = js.number(node.selector.invocationMirrorKind);
js.Expression arguments = new js.ArrayInitializer(
visitExpressionList(node.arguments));
@@ -622,7 +624,7 @@ class CodeGenerator extends tree_ir.StatementVisitor
@override
js.Expression visitGetField(tree_ir.GetField node) {
- return new js.PropertyAccess.field(
+ return new js.PropertyAccess(
visitExpression(node.object),
glue.instanceFieldPropertyName(node.field));
}
@@ -630,7 +632,7 @@ class CodeGenerator extends tree_ir.StatementVisitor
@override
js.Assignment visitSetField(tree_ir.SetField node) {
js.PropertyAccess field =
- new js.PropertyAccess.field(
+ new js.PropertyAccess(
visitExpression(node.object),
glue.instanceFieldPropertyName(node.field));
return new js.Assignment(field, visitExpression(node.value));

Powered by Google App Engine
This is Rietveld 408576698