From 184266bd793c00f31d27768c0f0f3e8976dd20af Mon Sep 17 00:00:00 2001 From: chris Date: Thu, 7 Sep 2023 13:20:33 -0700 Subject: [PATCH] remove duplicate nextLoad call --- CHANGELOG.md | 2 ++ src/esmockLoader.js | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index df837253..13fb1dd5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # changelog + * 2.4.2 _tbd_ + * [remove duplicate nextLoad call](https://github.com/iambumblehead/esmock/pull/239) * 2.4.1 _Sep.07.2023_ * [detect null AND undefined](https://github.com/iambumblehead/esmock/pull/238) loader-resolved source defintions * restore commented-out test affected by un-caught `undefined` source definitions diff --git a/src/esmockLoader.js b/src/esmockLoader.js index 96af927b..b5f0024e 100644 --- a/src/esmockLoader.js +++ b/src/esmockLoader.js @@ -145,7 +145,7 @@ const load = async (url, context, nextLoad) => { if (importedNames && importedNames.length) { const nextLoadRes = await nextLoad(url, context) if (!iscommonjsmoduleRe.test(nextLoadRes.format)) - return nextLoad(url, context) + return nextLoadRes // nextLoadRes.source sometimes 'undefined' and other times 'null' :( const sourceIsNullLike = (