diff --git a/lib/once.js b/lib/once.js index 369ee162e..a851af259 100644 --- a/lib/once.js +++ b/lib/once.js @@ -1,8 +1,7 @@ -module.exports = function (f) { - var called; +module.exports = function (f, g) { return function () { - if (called) { return; } - called = true; + if (!f) { return; } f.apply(this, Array.prototype.slice.call(arguments)); + f = g; }; };