diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-07-19 19:49:44 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-19 19:49:44 +0200 |
commit | fa61956f03491101b6ef64423ea2f1f73af26a73 (patch) | |
tree | c3800702071ca78aa4dd71bdd0a59a9bbe460bdd /cli/js/web/custom_event.ts | |
parent | 53adde866dd399aa2509d14508642fce37afb8f5 (diff) |
Port internal TS code to JS (#6793)
Co-authored-by: Ryan Dahl <ry@tinyclouds.org>
Diffstat (limited to 'cli/js/web/custom_event.ts')
-rw-r--r-- | cli/js/web/custom_event.ts | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/cli/js/web/custom_event.ts b/cli/js/web/custom_event.ts deleted file mode 100644 index dad89f650..000000000 --- a/cli/js/web/custom_event.ts +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. - -import { EventImpl as Event } from "./event.ts"; -import { requiredArguments } from "./util.ts"; - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export class CustomEventImpl<T = any> extends Event implements CustomEvent { - readonly #detail: T; - - constructor(type: string, eventInitDict: CustomEventInit<T> = {}) { - super(type, eventInitDict); - requiredArguments("CustomEvent", arguments.length, 1); - const { detail } = eventInitDict; - this.#detail = detail as T; - } - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - get detail(): T { - return this.#detail; - } - - get [Symbol.toStringTag](): string { - return "CustomEvent"; - } -} - -Reflect.defineProperty(CustomEventImpl.prototype, "detail", { - enumerable: true, -}); |