Skip to content
This repository has been archived by the owner on Apr 3, 2024. It is now read-only.

Commit

Permalink
Change argument order in updateBreakpoint (#204)
Browse files Browse the repository at this point in the history
  • Loading branch information
kjin committed Dec 22, 2016
1 parent b19b32d commit 2ec1732
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
10 changes: 5 additions & 5 deletions src/agent/debuglet.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Debuglet.prototype.normalizeConfig_ = function(config) {
config = extend({}, defaultConfig, config);

if (config.keyFilename || config.credentials || config.projectId) {
throw new Error('keyFilename, projectId or credentials should be provided' +
throw new Error('keyFilename, projectId or credentials should be provided' +
' to the Debug module constructor rather than startAgent');
}

Expand Down Expand Up @@ -151,7 +151,7 @@ Debuglet.prototype.start = function() {
that.emit('initError', err);
return;
}

that.v8debug_ = v8debugapi.create(that.logger_, that.config_, jsStats, mapper);

id = id || hash;
Expand Down Expand Up @@ -365,7 +365,7 @@ Debuglet.prototype.scheduleBreakpointFetch_ = function(seconds) {
err);
that.fetcherActive_ = false;
// We back-off from fetching breakpoints, and try to register again
// after a while. Successful registration will restart the breakpoint
// after a while. Successful registration will restart the breakpoint
// fetcher.
that.scheduleRegistration_(
that.config_.internal.registerDelayOnFetcherErrorSec);
Expand Down Expand Up @@ -538,7 +538,7 @@ Debuglet.prototype.completeBreakpoint_ = function(breakpoint) {

that.logger_.info('\tupdating breakpoint data on server', breakpoint.id);
that.debugletApi_.updateBreakpoint(
breakpoint, that.debuggee_, function(err /*, body*/) {
that.debuggee_, breakpoint, function(err /*, body*/) {
if (err) {
that.logger_.error('Unable to complete breakpoint on server', err);
} else {
Expand All @@ -557,7 +557,7 @@ Debuglet.prototype.rejectBreakpoint_ = function(breakpoint) {
var that = this;

that.debugletApi_.updateBreakpoint(
breakpoint, that.debuggee_, function(err /*, body*/) {
that.debuggee_, breakpoint, function(err /*, body*/) {
if (err) {
that.logger_.error('Unable to complete breakpoint on server', err);
}
Expand Down
5 changes: 3 additions & 2 deletions src/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ util.inherits(Controller, common.ServiceObject);

/**
* Register to the API (implementation)
*
*
* @param {!function(?Error,Object=)} callback
* @private
*/
Expand Down Expand Up @@ -112,10 +112,11 @@ Controller.prototype.listBreakpoints = function(debuggee, callback) {

/**
* Update the server about breakpoint state
* @param {!Debuggee} debuggee
* @param {!Breakpoint} breakpoint
* @param {!Function} callback accepting (err, body)
*/
Controller.prototype.updateBreakpoint = function(breakpoint, debuggee, callback) {
Controller.prototype.updateBreakpoint = function(debuggee, breakpoint, callback) {
assert(debuggee.id, 'should have a registered debuggee');

breakpoint.action = 'capture';
Expand Down
2 changes: 1 addition & 1 deletion test/test-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ describe('Controller API', function() {
.reply(200, { kind: 'debugletcontroller#updateActiveBreakpointResponse'});
var debuggee = { id: 'fake-debuggee' };
var controller = new Controller(fakeDebug);
controller.updateBreakpoint(breakpoint, debuggee,
controller.updateBreakpoint(debuggee, breakpoint,
function(err, result) {
assert(!err, 'not expecting an error');
assert.equal(result.kind, 'debugletcontroller#updateActiveBreakpointResponse');
Expand Down

0 comments on commit 2ec1732

Please sign in to comment.