Add visual reporting of top-level reporter execution

This commit is contained in:
Tim Mickel 2016-07-07 19:42:38 -04:00
parent d4353458ff
commit 9c6dca8131
4 changed files with 32 additions and 0 deletions
src/engine

View file

@ -69,6 +69,12 @@ Runtime.BLOCK_GLOW_ON = 'BLOCK_GLOW_ON';
*/
Runtime.BLOCK_GLOW_OFF = 'BLOCK_GLOW_OFF';
/**
* Event name for visual value report.
* @const {string}
*/
Runtime.VISUAL_REPORT = 'VISUAL_REPORT';
/**
* Inherit from EventEmitter
*/
@ -218,6 +224,15 @@ Runtime.prototype.glowBlock = function (blockId, isGlowing) {
}
};
/**
* Emit value for reporter to show in the blocks.
* @param {string} blockId ID for the block.
* @param {string} value Value to show associated with the block.
*/
Runtime.prototype.visualReport = function (blockId, value) {
this.emit(Runtime.VISUAL_REPORT, blockId, String(value));
};
/**
* Return the Target for a particular thread.
* @param {!Thread} thread Thread to determine target for.