mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Compatibility with extensions
This commit is contained in:
@@ -29,6 +29,12 @@ var EventEmitter = function () {
|
||||
};
|
||||
|
||||
EventEmitter.prototype.on = function (event, listener) {
|
||||
// Unknown event used by external libraries?
|
||||
if (event === undefined) {
|
||||
console.trace('EventEmitter: Cannot listen to undefined event');
|
||||
return;
|
||||
}
|
||||
|
||||
if (typeof this.events[event] !== 'object') {
|
||||
this.events[event] = [];
|
||||
}
|
||||
|
Reference in New Issue
Block a user