| Index: sdk/lib/html/dart2js/html_dart2js.dart
|
| diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
|
| index 9e130a1e548ff39c0e3b8811eacd080a0b3332b9..fe3ab577b764bf7fde34de9c8e28bf54b95490e2 100644
|
| --- a/sdk/lib/html/dart2js/html_dart2js.dart
|
| +++ b/sdk/lib/html/dart2js/html_dart2js.dart
|
| @@ -11545,21 +11545,20 @@ class Geolocation native "*Geolocation" {
|
| int watchId;
|
| var controller;
|
| controller = new StreamController<Geoposition>(
|
| - onSubscriptionStateChange: () {
|
| - if (controller.hasListener) {
|
| - assert(watchId == null);
|
| - watchId = $dom_watchPosition(
|
| - (position) {
|
| - controller.add(_ensurePosition(position));
|
| - },
|
| - (error) {
|
| - controller.addError(error);
|
| - },
|
| - options);
|
| - } else {
|
| - assert(watchId != null);
|
| - $dom_clearWatch(watchId);
|
| - }
|
| + onListen: () {
|
| + assert(watchId == null);
|
| + watchId = $dom_watchPosition(
|
| + (position) {
|
| + controller.add(_ensurePosition(position));
|
| + },
|
| + (error) {
|
| + controller.addError(error);
|
| + },
|
| + options);
|
| + },
|
| + onCancel: () {
|
| + assert(watchId != null);
|
| + $dom_clearWatch(watchId);
|
| });
|
|
|
| return controller.stream;
|
|
|