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/2493
21 lines
452 B
JavaScript
21 lines
452 B
JavaScript
'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);
|
|
|