diff --git a/lib/default-encoding.js b/lib/default-encoding.js index 4404fd2..3042099 100644 --- a/lib/default-encoding.js +++ b/lib/default-encoding.js @@ -1,8 +1,8 @@ var defaultEncoding /* istanbul ignore next */ -if (process.browser) { +if (global.process && global.process.browser) { defaultEncoding = 'utf-8' -} else if (process.version) { +} else if (global.process && global.process.version) { var pVersionMajor = parseInt(process.version.split('.')[0].slice(1), 10) defaultEncoding = pVersionMajor >= 6 ? 'utf-8' : 'binary'