判斷對象是否為空,若為空,則為其賦以{}
this._events = this._events || {};
遍歷對象屬性:
for (let type in types) {
// we don't process space-separated events here for performance;
// it's a hot path since Layer uses the on(obj) syntax
this._on(type, types[type], fn);