新增Debug辅助Insist

This commit is contained in:
yhh
2021-01-18 19:54:41 +08:00
parent eca9ba7b82
commit 3e182db019
13 changed files with 163 additions and 67 deletions

View File

@@ -37,8 +37,7 @@ module es {
this._messageTable.set(eventType, list);
}
if (list.findIndex(funcPack => funcPack.func == handler) != -1)
console.warn("您试图添加相同的观察者两次");
Insist.isFalse(list.findIndex(funcPack => funcPack.func == handler) != -1, "您试图添加相同的观察者两次");
list.push(new FuncPack(handler, context));
}