Permalink
Browse files

Minor formatting fixes.

  • Loading branch information...
1 parent 8cbbffa commit b05d31476eae0f44a0743747692f996d949ed1ba @creationix committed Apr 5, 2010
Showing with 8 additions and 7 deletions.
  1. +8 −7 lib/conductor.js
View
15 lib/conductor.js
@@ -115,7 +115,8 @@ function Conduct(definitions) {
return function performerEngine() {
- var localPerformers = {};
+ var localPerformers = {},
+ handler = arguments[arguments.length - 1];
// Clone the performers structure so we don't mess with the original.
performers.forEach(function (performer, name) {
@@ -133,7 +134,6 @@ function Conduct(definitions) {
});
// Hook up the passed in callback if any
- var handler = arguments[arguments.length - 1];
if (typeof handler === 'function') {
localPerformers._.fn = handler;
}
@@ -168,17 +168,18 @@ function Conduct(definitions) {
}
function execute(performer) {
- var args = performer.extraArgs.concat(performer.pendingData);
+ var args = performer.extraArgs.concat(performer.pendingData),
+ result;
+ function callback() {
+ dispatch(performer.outputs, arguments);
+ }
if (performer.needsCallback) {
- function callback() {
- dispatch(performer.outputs, arguments);
- }
args.push(callback);
}
// Call the main function, catching any sync exceptions
try {
- var result = performer.fn.apply(null, args);
+ result = performer.fn.apply(null, args);
} catch (err) {
process.nextTick(function () {
dispatch(performer.outputs, [err]);

0 comments on commit b05d314

Please sign in to comment.