Comparing version 0.1.4 to 0.1.5
@@ -10,5 +10,10 @@ /* | ||
function copyProperties(from, to) { | ||
for(var key in from) | ||
to[key] = from[key]; | ||
return to; | ||
} | ||
Tapable.mixin = function mixinTapable(pt) { | ||
for(var name in Tapable.prototype) | ||
pt[name] = Tapable.prototype[name]; | ||
copyProperties(Tapable.prototype, pt); | ||
} | ||
@@ -48,3 +53,3 @@ | ||
this._currentPluginApply = 0; | ||
args.push(function next(err) { | ||
args.push(copyProperties(callback, function next(err) { | ||
if(err) return callback(err); | ||
@@ -57,3 +62,3 @@ this._currentPluginApply++; | ||
plugins[this._currentPluginApply].apply(this, args); | ||
}.bind(this)); | ||
}.bind(this))); | ||
plugins[0].apply(this, args); | ||
@@ -69,3 +74,3 @@ }; | ||
this._currentPluginApply = 0; | ||
args.push(function next(err) { | ||
args.push(copyProperties(callback, function next(err) { | ||
if(err) return callback(err); | ||
@@ -78,3 +83,3 @@ this._currentPluginApply++; | ||
plugins[this._currentPluginApply].apply(this, args); | ||
}.bind(this)); | ||
}.bind(this))); | ||
plugins[0].apply(this, args); | ||
@@ -88,3 +93,3 @@ }; | ||
this._currentPluginApply = 0; | ||
var next = function(err, value) { | ||
var next = copyProperties(callback, function(err, value) { | ||
if(err) return callback(err); | ||
@@ -97,3 +102,3 @@ this._currentPluginApply++; | ||
plugins[this._currentPluginApply].call(this, value, next); | ||
}.bind(this); | ||
}.bind(this)); | ||
plugins[0].call(this, init, next); | ||
@@ -108,3 +113,3 @@ }; | ||
var remaining = plugins.length; | ||
args.push(function(err) { | ||
args.push(copyProperties(callback, function(err) { | ||
if(remaining < 0) return; // ignore | ||
@@ -119,3 +124,3 @@ if(err) { | ||
} | ||
}); | ||
})); | ||
for(var i = 0; i < plugins.length; i++) { | ||
@@ -136,3 +141,3 @@ plugins[i].apply(this, args); | ||
args[args.length-1] = (function(i) { | ||
return function(err, result) { | ||
return copyProperties(callback, function(err, result) { | ||
if(i >= currentPos) return; // ignore | ||
@@ -152,3 +157,3 @@ done.push(i); | ||
} | ||
}; | ||
}); | ||
}(i)); | ||
@@ -155,0 +160,0 @@ plugins[i].apply(this, args); |
{ | ||
"name": "tapable", | ||
"version": "0.1.4", | ||
"version": "0.1.5", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -5,0 +5,0 @@ "description": "Just a little module for plugins.", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14394
290