From 40394f0c438f1ccbb2d0d17699321ace4a9ffab2 Mon Sep 17 00:00:00 2001 From: GarboMuffin Date: Sat, 5 Nov 2022 21:47:37 -0500 Subject: [PATCH] Revert "Move allAsyncExtensionsLoaded call from installTargets to _loadExtensions" The async extensions loading counter is not the most reliable thing, so let's not break block sharing if something went wrong. This reverts commit 042f979d590cd0a02a11023e53fd8b1888633a9a. --- src/virtual-machine.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/virtual-machine.js b/src/virtual-machine.js index 5a9fa024..f2a95411 100644 --- a/src/virtual-machine.js +++ b/src/virtual-machine.js @@ -645,10 +645,6 @@ class VirtualMachine extends EventEmitter { * @param {Map} extensionURLs A map of extension ID to URL */ async _loadExtensions (extensionIDs, extensionURLs = new Map()) { - // Wait for any custom extensions that are loading to finish loading. - // We won't be able to determine which URLs we still need to load until this happens. - await this.extensionManager.allAsyncExtensionsLoaded(); - const extensionPromises = []; for (const extensionID of extensionIDs) { if (this.extensionManager.isExtensionLoaded(extensionID)) { @@ -680,7 +676,9 @@ class VirtualMachine extends EventEmitter { * @param {boolean} wholeProject - set to true if installing a whole project, as opposed to a single sprite. * @returns {Promise} resolved once targets have been installed */ - installTargets (targets, extensions, wholeProject) { + async installTargets (targets, extensions, wholeProject) { + await this.extensionManager.allAsyncExtensionsLoaded(); + targets = targets.filter(target => !!target); return this._loadExtensions(extensions.extensionIDs, extensions.extensionURLs).then(() => {