diff --git a/lib/propobj.js b/lib/propobj.js index 6a78020..647cb19 100644 --- a/lib/propobj.js +++ b/lib/propobj.js @@ -78,14 +78,17 @@ exports.setup = function( dest, properties, methods ) /** * Set up destination object by copying over properties and methods * - * @param {Object} dest destination object - * @param {Object} properties properties to copy - * @param {Object=} methods methods to copy + * @param {Object} dest destination object + * @param {Object} properties properties to copy + * @param {Object=} methods methods to copy + * @param {boolean} unless_exists do not set if method already exists in dest * * @return {undefined} */ function doSetup( dest, properties, methods, unless_exists ) { + unless_exists = !!unless_exists; + var hasOwn = Array.prototype.hasOwnProperty; // copy over the methods