From a64a53e29f3b451a485343695a2bcc4a1be434e5 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Tue, 27 Oct 2020 02:21:08 -0400 Subject: [PATCH] Removes ?? from interpolation to support web --- src/system/string.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/string.ts b/src/system/string.ts index 9fed688..3d6a0c3 100644 --- a/src/system/string.ts +++ b/src/system/string.ts @@ -114,7 +114,7 @@ export function getTokensFromTemplate(template: string) { } // eslint-disable-next-line no-template-curly-in-string -const tokenSanitizeReplacement = "$${this.$1 ?? ''}"; +const tokenSanitizeReplacement = "$${$1=this.$1,($1 == null ? '' : $1)}"; const interpolationMap = new Map(); export function interpolate(template: string, context: object | undefined): string { @@ -138,7 +138,7 @@ const AsyncFunction = Object.getPrototypeOf(async function () { const tokenSanitizeReplacementAsync = // eslint-disable-next-line no-template-curly-in-string - "$${$1=this.$1,($1 != null && typeof $1.then === 'function' ? await $1 : $1) ?? ''}"; + "$${$1=this.$1,($1 == null ? '' : typeof $1.then === 'function' ? (($1 = await $1),$1 == null ? '' : $1) : $1)}"; const interpolationAsyncMap = new Map();