| Index: pkg/polymer/lib/src/instance.dart
|
| diff --git a/pkg/polymer/lib/src/instance.dart b/pkg/polymer/lib/src/instance.dart
|
| index f0bff99c4637274b00dd6c5d15419547f71b76d9..f2f1f873e4e8f1a077fb354c253fcdb7127074f8 100644
|
| --- a/pkg/polymer/lib/src/instance.dart
|
| +++ b/pkg/polymer/lib/src/instance.dart
|
| @@ -509,15 +509,13 @@ class PolymerElement extends CustomElement with ObservableMixin {
|
| }
|
|
|
| void observeProperty(String name, Symbol method) {
|
| - final self = reflect(this);
|
| - _observe(name, (value, old) => self.invoke(method, [old]));
|
| + _observe(name, (value, old) => _invoke(method, [old]));
|
| }
|
|
|
| void observeBoth(String name, Symbol methodName) {
|
| - final self = reflect(this);
|
| _observe(name, (value, old) {
|
| reflectPropertyToAttribute(name);
|
| - self.invoke(methodName, [old]);
|
| + _invoke(methodName, [old]);
|
| });
|
| }
|
|
|
| @@ -646,10 +644,18 @@ class PolymerElement extends CustomElement with ObservableMixin {
|
| bool log = _eventsLog.isLoggable(Level.INFO);
|
| if (log) _eventsLog.info('>>> [$localName]: dispatch $methodName');
|
|
|
| - // TODO(sigmund): consider making event listeners list all arguments
|
| - // explicitly. Unless VM mirrors are optimized first, this reflectClass call
|
| - // will be expensive once custom elements extend directly from Element (see
|
| - // dartbug.com/11108).
|
| + _invoke(methodName, args);
|
| +
|
| + if (log) _eventsLog.info('<<< [$localName]: dispatch $methodName');
|
| +
|
| + // TODO(jmesserly): workaround for HTML events not supporting zones.
|
| + performMicrotaskCheckpoint();
|
| + }
|
| +
|
| + InstanceMirror _invoke(Symbol methodName, List args) {
|
| + // TODO(sigmund): consider making callbacks list all arguments
|
| + // explicitly. Unless VM mirrors are optimized first, this will be expensive
|
| + // once custom elements extend directly from Element (see issue 11108).
|
| var self = reflect(this);
|
| var method = self.type.methods[methodName];
|
| if (method != null) {
|
| @@ -659,12 +665,7 @@ class PolymerElement extends CustomElement with ObservableMixin {
|
| // them appart from named arguments (see http://dartbug.com/11334)
|
| args.length = method.parameters.where((p) => !p.isOptional).length;
|
| }
|
| - self.invoke(methodName, args);
|
| -
|
| - if (log) _eventsLog.info('<<< [$localName]: dispatch $methodName');
|
| -
|
| - // TODO(jmesserly): workaround for HTML events not supporting zones.
|
| - performMicrotaskCheckpoint();
|
| + return self.invoke(methodName, args);
|
| }
|
|
|
| void instanceEventListener(Event event) {
|
|
|