Skip to content

Commit 65f0f47

Browse files
Merge pull request #12 from bernardmcmanus/fix-deprecate-in-browser
fix issue #11
2 parents 0915f59 + e74c9c4 commit 65f0f47

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

util.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,17 +73,17 @@ exports.format = function(f) {
7373
// Returns a modified function which warns once by default.
7474
// If --no-deprecation is set, then it is a no-op.
7575
exports.deprecate = function(fn, msg) {
76+
if (typeof process !== 'undefined' && process.noDeprecation === true) {
77+
return fn;
78+
}
79+
7680
// Allow for deprecating things in the process of starting up.
77-
if (isUndefined(global.process)) {
81+
if (typeof process === 'undefined') {
7882
return function() {
7983
return exports.deprecate(fn, msg).apply(this, arguments);
8084
};
8185
}
8286

83-
if (process.noDeprecation === true) {
84-
return fn;
85-
}
86-
8787
var warned = false;
8888
function deprecated() {
8989
if (!warned) {

0 commit comments

Comments
 (0)