summaryrefslogtreecommitdiff
path: root/cli/js/globals.ts
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2020-03-24 20:56:40 -0700
committerGitHub <noreply@github.com>2020-03-24 23:56:40 -0400
commit5d7bcf86fdb2bfcee0bfac24aeb7aeecb8b3faca (patch)
tree07e3f9b315253c27924687100a6e1891768696dc /cli/js/globals.ts
parent3938071e91e7c3dcf7b4e727601e1e99005aceab (diff)
feat: window.close() (#4474)
Diffstat (limited to 'cli/js/globals.ts')
-rw-r--r--cli/js/globals.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/cli/js/globals.ts b/cli/js/globals.ts
index ada491bde..d71a96d39 100644
--- a/cli/js/globals.ts
+++ b/cli/js/globals.ts
@@ -179,6 +179,14 @@ export function readOnly(value: unknown): PropertyDescriptor {
};
}
+// eslint-disable-next-line @typescript-eslint/no-explicit-any
+export function getterOnly(getter: () => any): PropertyDescriptor {
+ return {
+ get: getter,
+ enumerable: true
+ };
+}
+
// https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope
export const windowOrWorkerGlobalScopeMethods = {
atob: writable(textEncoding.atob),