| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 class EventsImplementation implements Events { | 5 class EventsImplementation implements Events { |
| 6 /* Raw event target. */ | 6 /* Raw event target. */ |
| 7 var _ptr; | 7 var _ptr; |
| 8 | 8 |
| 9 Map<String, EventListenerList> _listenerMap; | 9 Map<String, EventListenerList> _listenerMap; |
| 10 | 10 |
| 11 EventsImplementation._wrap(this._ptr) { | 11 EventsImplementation._wrap(this._ptr) { |
| 12 _listenerMap = <String, EventListenerList>{}; | 12 _listenerMap = <EventListenerList>{}; |
| 13 } | 13 } |
| 14 | 14 |
| 15 EventListenerList operator [](String type) { | 15 EventListenerList operator [](String type) { |
| 16 return _get(type.toLowerCase()); | 16 return _get(type.toLowerCase()); |
| 17 } | 17 } |
| 18 | 18 |
| 19 EventListenerList _get(String type) { | 19 EventListenerList _get(String type) { |
| 20 return _listenerMap.putIfAbsent(type, | 20 return _listenerMap.putIfAbsent(type, |
| 21 () => new EventListenerListImplementation(_ptr, type)); | 21 () => new EventListenerListImplementation(_ptr, type)); |
| 22 } | 22 } |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 EventTargetWrappingImplementation._wrap(ptr) : super._wrap(ptr); | 110 EventTargetWrappingImplementation._wrap(ptr) : super._wrap(ptr); |
| 111 | 111 |
| 112 Events get on() { | 112 Events get on() { |
| 113 if (_on === null) { | 113 if (_on === null) { |
| 114 _on = new EventsImplementation._wrap(_ptr); | 114 _on = new EventsImplementation._wrap(_ptr); |
| 115 } | 115 } |
| 116 return _on; | 116 return _on; |
| 117 } | 117 } |
| 118 } | 118 } |
| OLD | NEW |