From 78ffe3f87002246897efb8cfcce96635301c00de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rados=C5=82aw=20Miernik?= Date: Thu, 16 Nov 2023 10:43:37 +0100 Subject: [PATCH] Switched to ES5-friendly isPromiseLike helper. --- packages/blaze/materializer.js | 2 +- packages/spacebars/spacebars-runtime.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/blaze/materializer.js b/packages/blaze/materializer.js index 40e1338db..0a05ea85a 100644 --- a/packages/blaze/materializer.js +++ b/packages/blaze/materializer.js @@ -93,7 +93,7 @@ var materializeDOMInner = function (htmljs, intoArray, parentView, workStack) { throw new Error("Unexpected object in htmljs: " + htmljs); }; -const isPromiseLike = x => typeof x?.then === 'function'; +const isPromiseLike = x => !!x && typeof x.then === 'function'; function waitForAllAttributesAndContinue(attrs, fn) { const promises = []; diff --git a/packages/spacebars/spacebars-runtime.js b/packages/spacebars/spacebars-runtime.js index 8baabead1..9f7f958b2 100644 --- a/packages/spacebars/spacebars-runtime.js +++ b/packages/spacebars/spacebars-runtime.js @@ -175,7 +175,7 @@ Spacebars.call = function (value/*, args*/) { } }; -const isPromiseLike = x => typeof x?.then === 'function'; +const isPromiseLike = x => !!x && typeof x.then === 'function'; // Call this as `Spacebars.kw({ ... })`. The return value // is `instanceof Spacebars.kw`.