backwards compatibility with plugins that are assuming no callback

v1.18.x
Julian Lam 11 years ago
parent a7f310b49a
commit 19c9f1bb19

@ -1 +0,0 @@
*.tpl

@ -315,12 +315,17 @@ var fs = require('fs'),
case 'filter':
async.reduce(hookList, args, function(value, hookObj, next) {
if (hookObj.method) {
if (hookObj.callbacked) {
hookObj.method.apply(Plugins, value.concat(function() {
if (!hookObj.hasOwnProperty('callbacked') || hookObj.callbacked === true) {
var value = hookObj.method.apply(Plugins, value.concat(function() {
next(arguments[0], Array.prototype.slice.call(arguments, 1));
}));
if (value !== undefined) {
winston.warn('[plugins/' + hookObj.id + '] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: ' + hook);
next(null, [value]);
}
} else {
winston.warn('[plugins] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: ' + hook);
winston.warn('[plugins/' + hookObj.id + '] "callbacked" deprecated as of 0.4x. Use asynchronous method instead for hook: ' + hook);
value = hookObj.method.apply(Plugins, value);
next(null, [value]);
}

Loading…
Cancel
Save