mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 20:29:11 +00:00
Check Event
constructor params (#1997)
This commit is contained in:
parent
d8714281b4
commit
ed2977d3c0
2 changed files with 15 additions and 1 deletions
|
@ -68,3 +68,15 @@ test(function eventPreventDefaultSuccess() {
|
|||
cancelableEvent.preventDefault();
|
||||
assertEquals(cancelableEvent.defaultPrevented, true);
|
||||
});
|
||||
|
||||
test(function eventInitializedWithNonStringType() {
|
||||
const type = undefined;
|
||||
const event = new Event(type);
|
||||
|
||||
assertEquals(event.isTrusted, false);
|
||||
assertEquals(event.target, null);
|
||||
assertEquals(event.currentTarget, null);
|
||||
assertEquals(event.type, "undefined");
|
||||
assertEquals(event.bubbles, false);
|
||||
assertEquals(event.cancelable, false);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue