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

Unified Diff: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart

Issue 2666803002: Add SuperPropertyGet. (Closed)
Patch Set: . Created 3 years, 11 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
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
diff --git a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
index 7ee6e778ba93b21f51d842ca73a40b475a7dfc6a..a7e6db6d2be7cabd9b55012bd00e68b309653f4d 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -202,8 +202,18 @@ class KernelAstAdapter implements KernelElementAdapter {
}
Selector getSelector(ir.Expression node) {
- if (node is ir.PropertyGet) return getGetterSelector(node);
- if (node is ir.PropertySet) return getSetterSelector(node);
+ // TODO(efortuna): This is screaming for a common interface between
+ // PropertyGet and SuperPropertyGet (and same for *Get). Talk to kernel
+ // folks.
+ if (node is ir.PropertyGet) {
+ return getGetterSelector((node as ir.PropertyGet).name);
+ }
+ if (node is ir.SuperPropertyGet) {
+ return getGetterSelector((node as ir.SuperPropertyGet).name);
+ }
+ if (node is ir.PropertySet || node is ir.SuperPropertySet) {
+ return getSetterSelector(node);
+ }
if (node is ir.InvocationExpression) return getInvocationSelector(node);
_compiler.reporter.internalError(getNode(node),
"Can only get the selector for a property get or an invocation.");
@@ -227,8 +237,7 @@ class KernelAstAdapter implements KernelElementAdapter {
return new Selector(kind, name, callStructure);
}
- Selector getGetterSelector(ir.PropertyGet getter) {
- ir.Name irName = getter.name;
+ Selector getGetterSelector(ir.Name irName) {
Name name = new Name(
irName.name, irName.isPrivate ? getElement(irName.library) : null);
return new Selector.getter(name);
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder_kernel.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698