From 6fb0743f7b94ec868871f24029c685608c88e48d Mon Sep 17 00:00:00 2001 From: Andrew Joslin Date: Wed, 25 Mar 2015 08:51:13 -0600 Subject: [PATCH] use hasOwnProperty for safe `for in` loop on defaults --- src/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.js b/src/util.js index 2bc9b1c563..cb85ac9d2d 100644 --- a/src/util.js +++ b/src/util.js @@ -20,7 +20,7 @@ export function defaults(dest) { for (let i = arguments.length - 1; i >= 1; i--) { let source = arguments[i] || {}; for (let key in source) { - if (!dest.hasOwnProperty(key)) { + if (source.hasOwnProperty(key) && !dest.hasOwnProperty(key)) { dest[key] = source[key]; } }