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

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..361b929b151db6b43511aa887172df18b05a8436 100644
--- a/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
+++ b/pkg/compiler/lib/src/ssa/kernel_ast_adapter.dart
@@ -202,8 +202,12 @@ 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);
+ if (node is ir.PropertyGet || node is ir.SuperPropertyGet) {
+ return getGetterSelector(node);
+ }
+ 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,14 +231,18 @@ class KernelAstAdapter implements KernelElementAdapter {
return new Selector(kind, name, callStructure);
}
- Selector getGetterSelector(ir.PropertyGet getter) {
+ Selector getGetterSelector(ir.Expression getter) {
+ // Getter is a PropertyGet or SuperPropertyGet.
+ // TODO(efortuna): Common interface?
Emily Fortuna 2017/01/31 00:17:16 these are clearly screaming out for a common inter
ir.Name irName = getter.name;
Name name = new Name(
irName.name, irName.isPrivate ? getElement(irName.library) : null);
return new Selector.getter(name);
}
- Selector getSetterSelector(ir.PropertySet setter) {
+ Selector getSetterSelector(ir.Expression setter) {
+ // Getter is a PropertySet or SuperPropertySet.
+ // TODO(efortuna): Common interface?
ir.Name irName = setter.name;
Name name = new Name(
irName.name, irName.isPrivate ? getElement(irName.library) : null);
« 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