Fire remove monitors VM event

This commit is contained in:
DD Liu 2017-05-10 15:47:06 -04:00
parent 138b4631e1
commit b1355c6b0b
3 changed files with 29 additions and 5 deletions
src/engine

View file

@ -241,6 +241,14 @@ class Runtime extends EventEmitter {
return 'MONITORS_UPDATE';
}
/**
* Event name for monitors removed.
* @const {string}
*/
static get MONITORS_REMOVED () {
return 'MONITORS_REMOVED';
}
/**
* How rapidly we try to step threads by default, in ms.
*/
@ -859,12 +867,20 @@ class Runtime extends EventEmitter {
/**
* Emit a monitor update which adds or updates if exists the given monitors.
* @param {!Array} monitors Array of all monitors
* @param {!Array} monitors Array of monitors to update.
*/
updateMonitors (monitors) {
this.emit(Runtime.MONITORS_UPDATE, monitors);
}
/**
* Emit a monitor update which removes if exists the given monitors.
* @param {!Array} monitors Array of monitors to remove.
*/
removeMonitors (monitors) {
this.emit(Runtime.MONITORS_REMOVED, monitors);
}
/**
* Get a target by its id.
* @param {string} targetId Id of target to find.