clearTimeout's params should not be bigint (#2838)

This commit is contained in:
迷渡 2019-08-30 23:51:53 +08:00 committed by Ryan Dahl
parent c370f749b2
commit 65fa2b810b
2 changed files with 17 additions and 0 deletions

View file

@ -259,6 +259,21 @@ test(function setTimeoutShouldThrowWithBigint(): void {
assertEquals(hasThrown, 2);
});
test(function clearTimeoutShouldThrowWithBigint(): void {
let hasThrown = 0;
try {
clearTimeout((1n as unknown) as number);
hasThrown = 1;
} catch (err) {
if (err instanceof TypeError) {
hasThrown = 2;
} else {
hasThrown = 3;
}
}
assertEquals(hasThrown, 2);
});
test(function testFunctionName(): void {
assertEquals(clearTimeout.name, "clearTimeout");
assertEquals(clearInterval.name, "clearInterval");