diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-05-10 16:49:35 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-05-10 16:49:37 +0200 |
commit | 928d28a7b326fb8f47ded5257ede7634fe44578b (patch) | |
tree | 34981e7f48807ebda3a2e044845f296336f5dd36 /lib/util.js | |
parent | 5979f096d1b702ca2ba95664a0bbc8210109775b (diff) | |
download | android-node-v8-928d28a7b326fb8f47ded5257ede7634fe44578b.tar.gz android-node-v8-928d28a7b326fb8f47ded5257ede7634fe44578b.tar.bz2 android-node-v8-928d28a7b326fb8f47ded5257ede7634fe44578b.zip |
util: make _extend() more robust
Add a better 'is object?' check, the old one let values like true slip through.
Diffstat (limited to 'lib/util.js')
-rw-r--r-- | lib/util.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/util.js b/lib/util.js index ce6aff496a..50595fd3f7 100644 --- a/lib/util.js +++ b/lib/util.js @@ -509,7 +509,7 @@ exports.inherits = function(ctor, superCtor) { exports._extend = function(origin, add) { // Don't do anything if add isn't an object - if (!add) return origin; + if (!add || typeof add !== 'object') return origin; var keys = Object.keys(add); var i = keys.length; |