Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

Commit

Permalink
updaed debug
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanGRomano committed Jul 19, 2014
1 parent a847bbf commit 204ff54
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
7 changes: 4 additions & 3 deletions lib/builder.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var util = require('util')
, events = require('events')
, debug = require('debug')('builder')
, debug = require('debug')('bus.io-common:builder')
, Message = require('./message')
, slice = Array.prototype.slice
;

module.exports = Builder;
Expand Down Expand Up @@ -32,7 +33,7 @@ util.inherits(Builder, events.EventEmitter);

'actor action target content id created reference published'.split(' ').forEach(function (name) {
Builder.prototype[name] = function () {
var v = this.message[name].apply(this.message,Array.prototype.slice.call(arguments));
var v = this.message[name].apply(this.message,slice.call(arguments));
if ('object' === typeof v && (v === this.message || v.isMessage)) {
return this;
}
Expand Down Expand Up @@ -105,7 +106,7 @@ Builder.prototype.to = Builder.prototype.deliver = function () {
}

if (arguments.length > 1) {
var targets = Array.prototype.slice.call(arguments);
var targets = slice.call(arguments);
for (var i=1; i<targets.length; i++) {
var message = this.message.clone();
message.target(String(targets[i]));
Expand Down
7 changes: 4 additions & 3 deletions lib/controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
var util = require('util')
, events = require('events')
, debug = require('debug')('controller')
, debug = require('debug')('bus.io-common:controller')
, Message = require('./message')
, slice = Array.prototype.slice
;

module.exports = Controller;
Expand Down Expand Up @@ -93,7 +94,7 @@ Controller.prototype.deliver = function () {
}
else if (arguments.length > 1) {
debug('we have more than one arguments so deliver to each of them');
deliverEach(this, Array.prototype.slice.call(arguments));
deliverEach(this, slice.call(arguments));
}
return this;
};
Expand All @@ -104,7 +105,7 @@ Controller.prototype.deliver = function () {

'actor action target content id created reference published'.split(' ').forEach(function (name) {
Controller.prototype[name] = function () {
var v = this.message[name].apply(this.message,Array.prototype.slice.call(arguments));
var v = this.message[name].apply(this.message,slice.call(arguments));
if (v === this.message) {
return this;
}
Expand Down
7 changes: 4 additions & 3 deletions lib/message.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
var extend = require('extend')
, debug = require('debug')('message')
, debug = require('debug')('bus.io-common:message')
, uuid = require('node-uuid')
, slice = Array.prototype.slice
;

module.exports = Message;
Expand All @@ -19,15 +20,15 @@ function Message () {
else {
debug('creating new message and initializing with arguments');
var m = new Message();
Message.prototype.initialize.apply(m, Array.prototype.slice.call(arguments));
Message.prototype.initialize.apply(m, slice.call(arguments));
return m;
}
}
else {
this.isMessage = true;
if (arguments.length) {
debug('initializing with arguments');
Message.prototype.initialize.apply(this, Array.prototype.slice.call(arguments));
Message.prototype.initialize.apply(this, slice.call(arguments));
}
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bus.io-common",
"version": "0.1.1",
"version": "0.1.2",
"description": "The common components for bus.io",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit 204ff54

Please sign in to comment.