xref: /third_party/node/test/parallel/test-timers-api-refs.js
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci'use strict';
21cb0ef41Sopenharmony_ciconst common = require('../common');
31cb0ef41Sopenharmony_ciconst timers = require('timers');
41cb0ef41Sopenharmony_ci
51cb0ef41Sopenharmony_ci// Delete global APIs to make sure they're not relied on by the internal timers
61cb0ef41Sopenharmony_ci// code
71cb0ef41Sopenharmony_cidelete global.setTimeout;
81cb0ef41Sopenharmony_cidelete global.clearTimeout;
91cb0ef41Sopenharmony_cidelete global.setInterval;
101cb0ef41Sopenharmony_cidelete global.clearInterval;
111cb0ef41Sopenharmony_cidelete global.setImmediate;
121cb0ef41Sopenharmony_cidelete global.clearImmediate;
131cb0ef41Sopenharmony_ci
141cb0ef41Sopenharmony_ciconst timeoutCallback = () => { timers.clearTimeout(timeout); };
151cb0ef41Sopenharmony_ciconst timeout = timers.setTimeout(common.mustCall(timeoutCallback), 1);
161cb0ef41Sopenharmony_ci
171cb0ef41Sopenharmony_ciconst intervalCallback = () => { timers.clearInterval(interval); };
181cb0ef41Sopenharmony_ciconst interval = timers.setInterval(common.mustCall(intervalCallback), 1);
191cb0ef41Sopenharmony_ci
201cb0ef41Sopenharmony_ciconst immediateCallback = () => { timers.clearImmediate(immediate); };
211cb0ef41Sopenharmony_ciconst immediate = timers.setImmediate(immediateCallback);
22

Indexes created Thu Nov 07 10:32:03 CST 2024