From c7481d4da10672797f8c95cb9ed3025eeb62c03e Mon Sep 17 00:00:00 2001 From: David Majda Date: Sun, 6 Jan 2013 10:35:09 +0100 Subject: [PATCH] Test property presence in |utils.defaults| using |in| This is more correct than comparing to |undefined|. --- lib/utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/utils.js b/lib/utils.js index cf6aacc..ed08fc0 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -92,7 +92,7 @@ var utils = { defaults: function(object, defaults) { for (var key in defaults) { - if (object[key] === undefined) { + if (!(key in object)) { object[key] = defaults[key]; } }