event.on("newListener", function (EventName, callback) { callback({EventName: EventName}); }); event.addListener("aaa", function (value) { console.log(“我是注册时事件自动触发的” + value.EventName + “事件!”); });// 正常输出:我是注册事件时自动触发的aaa事件!
event.on("removeListener", function (EventName, callback) { callback({EventName: EventName}); }); var callbackName = function (value) { console.log(“我是删除事件时自动触发的” + value.EventName + “事件!”); } event.on("ddd", callbackName); event.removeListener("ddd", callbackName); // 报错!event.js:76 callback({EventName: EventName});