diff --git a/.travis.yml b/.travis.yml index 895dbd3..5346f6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,7 @@ language: node_js node_js: - - 0.6 - - 0.8 + - "node" + - "6" + - "4" + - "0.12" + - "0.10" diff --git a/index.js b/index.js index 4f45b70..69b7d79 100644 --- a/index.js +++ b/index.js @@ -2,11 +2,9 @@ module.exports = function deepFreeze (o) { Object.freeze(o); var oIsFunction = typeof o === "function"; - var hasOwnProp = Object.prototype.hasOwnProperty; Object.getOwnPropertyNames(o).forEach(function (prop) { - if (hasOwnProp.call(o, prop) - && (oIsFunction ? prop !== 'caller' && prop !== 'callee' && prop !== 'arguments' : true ) + if ((oIsFunction ? prop !== 'caller' && prop !== 'callee' && prop !== 'arguments' : true ) && o[prop] !== null && (typeof o[prop] === "object" || typeof o[prop] === "function") && !Object.isFrozen(o[prop])) {