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

Unified Diff: pkg/polymer/lib/src/instance.dart

Issue 79353003: [polymer.dart] fix *Changed observers inheriting (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/polymer/lib/src/instance.dart
diff --git a/pkg/polymer/lib/src/instance.dart b/pkg/polymer/lib/src/instance.dart
index 47809ee25abebf047826a316391dd7bf816e214b..f3ad9eadf381f1955135cd06f494399efbb4dd00 100644
--- a/pkg/polymer/lib/src/instance.dart
+++ b/pkg/polymer/lib/src/instance.dart
@@ -794,8 +794,8 @@ abstract class Polymer implements Element, Observable, NodeBindExtension {
// explicitly. Unless VM mirrors are optimized first, this will be expensive
// once custom elements extend directly from Element (see issue 11108).
var receiverMirror = reflect(receiver);
- var method = receiverMirror.type.declarations[methodName];
- if (method != null && method is MethodMirror) {
+ var method = _findMethod(receiverMirror.type, methodName);
+ if (method != null) {
// This will either truncate the argument list or extend it with extra
// null arguments, so it will match the signature.
// TODO(sigmund): consider accepting optional arguments when we can tell
@@ -805,6 +805,14 @@ abstract class Polymer implements Element, Observable, NodeBindExtension {
return receiverMirror.invoke(methodName, args).reflectee;
}
+ static MethodMirror _findMethod(ClassMirror type, Symbol name) {
+ do {
+ var member = type.declarations[name];
+ if (member is MethodMirror) return member;
+ type = type.superclass;
+ } while (type != null);
+ }
+
/**
* Invokes a function asynchronously.
* This will call `Platform.flush()` and then return a `new Timer`

Powered by Google App Engine
This is Rietveld 408576698