mirror of https://github.com/lukechilds/node.git
Browse Source
Added safe internal references for 'clearTimeout(..)', 'active(..)', and 'unenroll(..)'. Changed various API refs from 'export.*' to use these safe internal references. Now, overwriting the global API identifiers does not create potential breakage and/or race conditions. See Issue #2493. PR-URL: https://github.com/nodejs/node/pull/5882 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Fixes: https://github.com/nodejs/node/issues/2493process-exit-stdio-flushing
committed by
Rich Trott
2 changed files with 28 additions and 8 deletions
@ -0,0 +1,20 @@ |
|||
'use strict'; |
|||
const common = require('../common'); |
|||
const assert = require('assert'); |
|||
|
|||
// don't verify the globals for this test
|
|||
common.globalCheck = false; |
|||
|
|||
// try overriding global APIs to make sure
|
|||
// they're not relied on by the timers
|
|||
global.clearTimeout = assert.fail; |
|||
|
|||
// run timeouts/intervals through the paces
|
|||
const intv = setInterval(function() {}, 1); |
|||
|
|||
setTimeout(function() { |
|||
clearInterval(intv); |
|||
}, 100); |
|||
|
|||
setTimeout(function() {}, 2); |
|||
|
Loading…
Reference in new issue