mirror of
https://github.com/denoland/deno.git
synced 2025-09-27 12:49:10 +00:00
clearTimeout's params should not be bigint (#2838)
This commit is contained in:
parent
c370f749b2
commit
65fa2b810b
2 changed files with 17 additions and 0 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue