diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2020-04-09 06:03:44 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-09 12:03:44 +0200 |
commit | 198a045dbee7b0350055b7f88f1e0670da87fb3b (patch) | |
tree | d0876a8d20360072bb38b41290dca98d052f97ba /cli/js/tests | |
parent | 90d683127147975a08df45bac0de6b719ca07ce4 (diff) |
Remove __event, __eventTarget, __customEvent namespaces (#4683)
Diffstat (limited to 'cli/js/tests')
-rw-r--r-- | cli/js/tests/event_target_test.ts | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/cli/js/tests/event_target_test.ts b/cli/js/tests/event_target_test.ts index 45f626502..ece4b5dba 100644 --- a/cli/js/tests/event_target_test.ts +++ b/cli/js/tests/event_target_test.ts @@ -35,12 +35,24 @@ unitTest(function constructedEventTargetCanBeUsedAsExpected(): void { assertEquals(callCount, 2); }); +// TODO(ry) Should AddEventListenerOptions and EventListenerOptions be exposed +// from the public API? + +interface AddEventListenerOptions extends EventListenerOptions { + once?: boolean; + passive?: boolean; +} + +interface EventListenerOptions { + capture?: boolean; +} + unitTest(function anEventTargetCanBeSubclassed(): void { class NicerEventTarget extends EventTarget { on( type: string, callback: ((e: Event) => void) | null, - options?: __domTypes.AddEventListenerOptions + options?: AddEventListenerOptions ): void { this.addEventListener(type, callback, options); } @@ -48,7 +60,7 @@ unitTest(function anEventTargetCanBeSubclassed(): void { off( type: string, callback: ((e: Event) => void) | null, - options?: __domTypes.EventListenerOptions + options?: EventListenerOptions ): void { this.removeEventListener(type, callback, options); } |