bugger-v8-client
Version:
Client for v8 debug protocol
26 lines (21 loc) • 647 B
JavaScript
;
var _ = require('lodash');
module.exports = function(DebugClient) {
DebugClient.prototype.suspend =
function suspend() {
return this._sendRequest('suspend').then(_.noop);
};
DebugClient.prototype.pause = DebugClient.prototype.suspend;
DebugClient.prototype.waitForPaused =
function waitForPaused() {
var debugClient = this, wasRunning;
return debugClient._sendRequest('version')
.then(function() {
wasRunning = debugClient.running;
if (wasRunning === true) {
return debugClient.nextEvent('paused');
}
})
.then(function() { return wasRunning; });
}
};