Skip to content

Commit 566ca43

Browse files
author
vdemedes
committed
detect node without browserify polyfilling process
1 parent b15809f commit 566ca43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ var SETTLED = 'settled';
55
var FULFILLED = 'fulfilled';
66
var REJECTED = 'rejected';
77
var NOOP = function () {};
8-
var isNode = typeof process !== 'undefined' && typeof process.emit === 'function';
8+
var isNode = global.process !== 'undefined' && typeof global.process.emit === 'function';
99

1010
var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
1111
var asyncQueue = [];
@@ -156,12 +156,12 @@ function publishRejection(promise) {
156156
promise._state = REJECTED;
157157
publish(promise);
158158
if (!promise._handled && isNode) {
159-
process.emit('unhandledRejection', promise._data, promise);
159+
global.process.emit('unhandledRejection', promise._data, promise);
160160
}
161161
}
162162

163163
function notifyRejectionHandled(promise) {
164-
process.emit('rejectionHandled', promise);
164+
global.process.emit('rejectionHandled', promise);
165165
}
166166

167167
/**

0 commit comments

Comments
 (0)