Comparing version 0.2.5 to 0.2.6
@@ -5,2 +5,38 @@ /* | ||
*/ | ||
// polyfill from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter | ||
// using the polyfill specifically to avoid the call to `Object.defineProperty` for performance reasons | ||
function fastFilter(fun/*, thisArg*/) { | ||
'use strict'; | ||
if (this === void 0 || this === null) { | ||
throw new TypeError(); | ||
} | ||
var t = Object(this); | ||
var len = t.length >>> 0; | ||
if (typeof fun !== 'function') { | ||
throw new TypeError(); | ||
} | ||
var res = []; | ||
var thisArg = arguments.length >= 2 ? arguments[1] : void 0; | ||
for (var i = 0; i < len; i++) { | ||
if (i in t) { | ||
var val = t[i]; | ||
// NOTE: Technically this should Object.defineProperty at | ||
// the next index, as push can be affected by | ||
// properties on Object.prototype and Array.prototype. | ||
// But that method's new, and collisions should be | ||
// rare, so use the more-compatible alternative. | ||
if (fun.call(thisArg, val, i, t)) { | ||
res.push(val); | ||
} | ||
} | ||
} | ||
return res; | ||
} | ||
function Tapable() { | ||
@@ -214,3 +250,3 @@ this._plugins = {}; | ||
currentPos = i + 1; | ||
done = done.filter(function(item) { | ||
done = fastFilter.call(done, function(item) { | ||
return item <= i; | ||
@@ -243,3 +279,3 @@ }); | ||
currentPos = i + 1; | ||
done = done.filter(function(item) { | ||
done = fastFilter.call(done, function(item) { | ||
return item <= i; | ||
@@ -246,0 +282,0 @@ }); |
{ | ||
"name": "tapable", | ||
"version": "0.2.5", | ||
"version": "0.2.6", | ||
"author": "Tobias Koppers @sokra", | ||
@@ -18,2 +18,5 @@ "description": "Just a little module for plugins.", | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"homepage": "https://github.com/webpack/tapable", | ||
@@ -20,0 +23,0 @@ "main": "lib/Tapable.js", |
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
14703
3
280