判断对象是否为空,若为空,则为其赋以{}
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);