11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ciconst assert = require('assert'); 51cb0ef41Sopenharmony_ciconst timers = require('timers'); 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci[ 81cb0ef41Sopenharmony_ci {}, 91cb0ef41Sopenharmony_ci [], 101cb0ef41Sopenharmony_ci 'foo', 111cb0ef41Sopenharmony_ci () => { }, 121cb0ef41Sopenharmony_ci Symbol('foo'), 131cb0ef41Sopenharmony_ci].forEach((val) => { 141cb0ef41Sopenharmony_ci assert.throws( 151cb0ef41Sopenharmony_ci () => timers.enroll({}, val), 161cb0ef41Sopenharmony_ci { 171cb0ef41Sopenharmony_ci code: 'ERR_INVALID_ARG_TYPE', 181cb0ef41Sopenharmony_ci name: 'TypeError' 191cb0ef41Sopenharmony_ci } 201cb0ef41Sopenharmony_ci ); 211cb0ef41Sopenharmony_ci}); 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci[ 241cb0ef41Sopenharmony_ci -1, 251cb0ef41Sopenharmony_ci Infinity, 261cb0ef41Sopenharmony_ci NaN, 271cb0ef41Sopenharmony_ci].forEach((val) => { 281cb0ef41Sopenharmony_ci assert.throws( 291cb0ef41Sopenharmony_ci () => timers.enroll({}, val), 301cb0ef41Sopenharmony_ci { 311cb0ef41Sopenharmony_ci code: 'ERR_OUT_OF_RANGE', 321cb0ef41Sopenharmony_ci name: 'RangeError', 331cb0ef41Sopenharmony_ci message: 'The value of "msecs" is out of range. ' + 341cb0ef41Sopenharmony_ci 'It must be a non-negative finite number. ' + 351cb0ef41Sopenharmony_ci `Received ${val}` 361cb0ef41Sopenharmony_ci } 371cb0ef41Sopenharmony_ci ); 381cb0ef41Sopenharmony_ci}); 39