diff --git a/lib/freeze.js b/lib/freeze.js index 4f7dd64..918d43e 100644 --- a/lib/freeze.js +++ b/lib/freeze.js @@ -32,12 +32,18 @@ function recur(object) { * Or if `process.env.UPDEEP_MODE === 'dangerously_never_freeze'`, this returns the original object * without freezing. * + * If in a browser and built without replacing process, never freeze. + * * @function * @sig a -> a * @param {object} object Object to freeze. * @return {object} Frozen object, unless in production, then the same object. */ function freeze(object) { + if (typeof process === 'undefined') { + return object + } + if (process.env.NODE_ENV === 'production') { return object }