* @function Events.prototype.on * @description 在一个相同的范围内注册监听器的方法,此方法调用 register 函数。 * @example * // 注册一个 "loadstart" 监听事件 * events.on({"loadstart": loadStartListener}); * * // 同样注册一个 "loadstart" 监听事件 * events.register("loadstart", undefined, loadStartListener);
(object)
| 223 | * @param {Object} object - 添加监听的对象。 |
| 224 | */ |
| 225 | on(object) { |
| 226 | for (var type in object) { |
| 227 | if (type !== "scope" && object.hasOwnProperty(type)) { |
| 228 | this.register(type, object.scope, object[type]); |
| 229 | } |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | |
| 234 | /** |
no test coverage detected