| Index: sdk/lib/html/dartium/html_dartium.dart
|
| diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
|
| index 42f05d078b74d83470b1c324f6400687bb535a05..02d69ff93afecbf06f357033781f38f294094729 100644
|
| --- a/sdk/lib/html/dartium/html_dartium.dart
|
| +++ b/sdk/lib/html/dartium/html_dartium.dart
|
| @@ -49043,9 +49043,9 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
|
|
|
| // TODO(leafp): It would be better to write this as
|
| // _onData = onData == null ? null :
|
| - // onData is void Function(Event)
|
| - // ? _wrapZone<Event>(onData)
|
| - // : _wrapZone<Event>((e) => onData(e as T))
|
| + // onData is _wrapZoneCallback<Event, dynamic>
|
| + // ? _wrapZone/*<Event, dynamic>*/(onData)
|
| + // : _wrapZone/*<Event, dynamic>*/((e) => onData(e as T))
|
| // In order to support existing tests which pass the wrong type of events but
|
| // use a more general listener, without causing as much slowdown for things
|
| // which are typed correctly. But this currently runs afoul of restrictions
|
| @@ -49054,7 +49054,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
|
| this._target, this._eventType, void onData(T event), this._useCapture)
|
| : _onData = onData == null
|
| ? null
|
| - : _wrapZone<Event>((e) => (onData as dynamic)(e)) {
|
| + : _wrapZone<Event, dynamic>((e) => (onData as dynamic)(e)) {
|
| _tryResume();
|
| }
|
|
|
| @@ -49076,7 +49076,7 @@ class _EventStreamSubscription<T extends Event> extends StreamSubscription<T> {
|
| }
|
| // Remove current event listener.
|
| _unlisten();
|
| - _onData = _wrapZone<Event>(handleData);
|
| + _onData = _wrapZone/*<Event, dynamic>*/(handleData);
|
| _tryResume();
|
| }
|
|
|
| @@ -52383,18 +52383,24 @@ class _WrappedEvent implements Event {
|
| // for details. All rights reserved. Use of this source code is governed by a
|
| // BSD-style license that can be found in the LICENSE file.
|
|
|
| -void Function(T) _wrapZone<T>(void Function(T) callback) {
|
| +// TODO(jacobr): remove these typedefs when dart:async supports generic types.
|
| +typedef R _wrapZoneCallback<A, R>(A a);
|
| +typedef R _wrapZoneBinaryCallback<A, B, R>(A a, B b);
|
| +
|
| +_wrapZoneCallback/*<A, R>*/ _wrapZone/*<A, R>*/(
|
| + _wrapZoneCallback/*<A, R>*/ callback) {
|
| // For performance reasons avoid wrapping if we are in the root zone.
|
| if (Zone.current == Zone.ROOT) return callback;
|
| if (callback == null) return null;
|
| - return Zone.current.bindUnaryCallbackGuarded(callback);
|
| + return Zone.current.bindUnaryCallback/*<R, A>*/(callback, runGuarded: true);
|
| }
|
|
|
| -void Function(T1, T2) _wrapBinaryZone<T1, T2>(void Function(T1, T2) callback) {
|
| - // For performance reasons avoid wrapping if we are in the root zone.
|
| +_wrapZoneBinaryCallback/*<A, B, R>*/ _wrapBinaryZone/*<A, B, R>*/(
|
| + _wrapZoneBinaryCallback/*<A, B, R>*/ callback) {
|
| if (Zone.current == Zone.ROOT) return callback;
|
| if (callback == null) return null;
|
| - return Zone.current.bindBinaryCallbackGuarded(callback);
|
| + return Zone.current
|
| + .bindBinaryCallback/*<R, A, B>*/(callback, runGuarded: true);
|
| }
|
|
|
| /**
|
|
|