Skip to content

Commit de7f4fa

Browse files
authored
Merge pull request #385 from chrisnicola/patch-1
Use local reference for clearTimeout global
2 parents fde8216 + 5565ef5 commit de7f4fa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/test.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ var nextTick = typeof setImmediate !== 'undefined'
1616
: process.nextTick
1717
;
1818
var safeSetTimeout = setTimeout;
19+
var safeClearTimeout = clearTimeout;
1920

2021
inherits(Test, EventEmitter);
2122

@@ -127,7 +128,7 @@ Test.prototype.timeoutAfter = function(ms) {
127128
self.end();
128129
}, ms);
129130
this.once('end', function() {
130-
clearTimeout(timeout);
131+
safeClearTimeout(timeout);
131132
});
132133
}
133134

0 commit comments

Comments
 (0)