From 42d3a2b1d73789d9a216ec61247f67c81283c3d1 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Thu, 10 Nov 2022 14:24:02 +0100 Subject: [PATCH] -fix polyfill --- packages/taler-util/src/url.ts | 12 ++++++++---- packages/taler-wallet-embedded/src/wallet-qjs.ts | 3 +++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/taler-util/src/url.ts b/packages/taler-util/src/url.ts index 245c4f8f7..eb7248b7b 100644 --- a/packages/taler-util/src/url.ts +++ b/packages/taler-util/src/url.ts @@ -83,20 +83,24 @@ export interface URLCtor { })(); // @ts-ignore -const _URL = globalThis.URL; +let _URL = globalThis.URL; if (!_URL) { // @ts-ignore - globalThis.URL = URLImpl; + globalThis.URL = _URL = URLImpl; + // @ts-ignore + _URL = URLImpl; } export const URL: URLCtor = _URL; // @ts-ignore -const _URLSearchParams = globalThis.URLSearchParams; +let _URLSearchParams = globalThis.URLSearchParams; if (!_URLSearchParams) { // @ts-ignore - globalThis.URL = URLSearchParamsImpl; + globalThis.URLSearchParams = URLSearchParamsImpl; + // @ts-ignore + _URLSearchParams = URLSearchParamsImpl; } export const URLSearchParams: URLSearchParamsCtor = _URLSearchParams; diff --git a/packages/taler-wallet-embedded/src/wallet-qjs.ts b/packages/taler-wallet-embedded/src/wallet-qjs.ts index 01882cc16..69cecb828 100644 --- a/packages/taler-wallet-embedded/src/wallet-qjs.ts +++ b/packages/taler-wallet-embedded/src/wallet-qjs.ts @@ -308,3 +308,6 @@ export function installNativeWalletListener(): void { logger.info("native wallet listener installed"); } + +// @ts-ignore +globalThis.installNativeWalletListener = installNativeWalletListener;