From b9d9a86053cc9c8dd276672cd132c1ddb1073f59 Mon Sep 17 00:00:00 2001 From: Tim Caswell Date: Sat, 20 Feb 2010 22:16:42 -0600 Subject: [PATCH] When converting a library, pass all properties through, but only convert the speficied ones. --- lib/do.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/do.js b/lib/do.js index d7f250a..0c0af0e 100644 --- a/lib/do.js +++ b/lib/do.js @@ -143,7 +143,10 @@ exports.cont = function (fn) { // the specified names to continuable style and returns the new library. exports.convert = function (lib, names) { var newlib = {}; - names.forEach(function (key) { + Object.keys(lib).forEach(function (key) { + if (names.indexOf(key) < 0) { + return newlib[key] = lib[key]; + } newlib[key] = function () { var args = Array.prototype.slice.call(arguments); return function (callback, errback) {