11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ciconst common = require('../common'); 31cb0ef41Sopenharmony_ci 41cb0ef41Sopenharmony_ci// This test makes sure that timers created with setTimeout can be disarmed by 51cb0ef41Sopenharmony_ci// clearInterval and that timers created with setInterval can be disarmed by 61cb0ef41Sopenharmony_ci// clearTimeout. 71cb0ef41Sopenharmony_ci// 81cb0ef41Sopenharmony_ci// This behavior is documented in the HTML Living Standard: 91cb0ef41Sopenharmony_ci// 101cb0ef41Sopenharmony_ci// * Refs: https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_ci// Disarm interval with clearTimeout. 131cb0ef41Sopenharmony_ciconst interval = setInterval(common.mustNotCall(), 1); 141cb0ef41Sopenharmony_ciclearTimeout(interval); 151cb0ef41Sopenharmony_ci 161cb0ef41Sopenharmony_ci// Disarm timeout with clearInterval. 171cb0ef41Sopenharmony_ciconst timeout = setTimeout(common.mustNotCall(), 1); 181cb0ef41Sopenharmony_ciclearInterval(timeout); 19