| OLD | NEW |
| 1 /// The Dart HTML library. | 1 /// The Dart HTML library. |
| 2 library dart.dom.html; | 2 library dart.dom.html; |
| 3 | 3 |
| 4 import 'dart:async'; | 4 import 'dart:async'; |
| 5 import 'dart:collection'; | 5 import 'dart:collection'; |
| 6 import 'dart:_collection-dev' hide Symbol; | 6 import 'dart:_collection-dev' hide Symbol; |
| 7 import 'dart:html_common'; | 7 import 'dart:html_common'; |
| 8 import 'dart:indexed_db'; | 8 import 'dart:indexed_db'; |
| 9 import 'dart:isolate'; | 9 import 'dart:isolate'; |
| 10 import 'dart:json' as json; | 10 import 'dart:json' as json; |
| (...skipping 26807 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 26818 * Observes [path] on [object] for changes. This returns an object that can be | 26818 * Observes [path] on [object] for changes. This returns an object that can be |
| 26819 * used to get the changes and get/set the value at this path. | 26819 * used to get the changes and get/set the value at this path. |
| 26820 * See [PathObserver.values] and [PathObserver.value]. | 26820 * See [PathObserver.values] and [PathObserver.value]. |
| 26821 */ | 26821 */ |
| 26822 PathObserver(this.object, String path) | 26822 PathObserver(this.object, String path) |
| 26823 : path = path, _isValid = _isPathValid(path) { | 26823 : path = path, _isValid = _isPathValid(path) { |
| 26824 | 26824 |
| 26825 // TODO(jmesserly): if the path is empty, or the object is! Observable, we | 26825 // TODO(jmesserly): if the path is empty, or the object is! Observable, we |
| 26826 // can optimize the PathObserver to be more lightweight. | 26826 // can optimize the PathObserver to be more lightweight. |
| 26827 | 26827 |
| 26828 _values = new StreamController.multiplex(onListen: _observe, | 26828 _values = new StreamController.broadcast(onListen: _observe, |
| 26829 onCancel: _unobserve); | 26829 onCancel: _unobserve); |
| 26830 | 26830 |
| 26831 if (_isValid) { | 26831 if (_isValid) { |
| 26832 var segments = []; | 26832 var segments = []; |
| 26833 for (var segment in path.trim().split('.')) { | 26833 for (var segment in path.trim().split('.')) { |
| 26834 if (segment == '') continue; | 26834 if (segment == '') continue; |
| 26835 var index = int.parse(segment, onError: (_) {}); | 26835 var index = int.parse(segment, onError: (_) {}); |
| 26836 segments.add(index != null ? index : new Symbol(segment)); | 26836 segments.add(index != null ? index : new Symbol(segment)); |
| 26837 } | 26837 } |
| 26838 | 26838 |
| (...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 29274 _position = nextPosition; | 29274 _position = nextPosition; |
| 29275 return true; | 29275 return true; |
| 29276 } | 29276 } |
| 29277 _current = null; | 29277 _current = null; |
| 29278 _position = _array.length; | 29278 _position = _array.length; |
| 29279 return false; | 29279 return false; |
| 29280 } | 29280 } |
| 29281 | 29281 |
| 29282 T get current => _current; | 29282 T get current => _current; |
| 29283 } | 29283 } |
| OLD | NEW |