From 0aac6f89a3cbf527f4931ffdbe896c235a693322 Mon Sep 17 00:00:00 2001 From: Florin Raducan Date: Wed, 6 Nov 2024 19:05:57 +0200 Subject: [PATCH] cleanup --- scripts/libs.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/scripts/libs.js b/scripts/libs.js index 828f593..d22c549 100644 --- a/scripts/libs.js +++ b/scripts/libs.js @@ -698,12 +698,8 @@ export const previewModule = async (path, name) => { }; export function yieldToMain() { - return new Promise((resolve, reject) => { - try { - setTimeout(resolve, 0); - } catch (error) { - reject(); - } + return new Promise((resolve) => { + setTimeout(resolve, 0); }); } @@ -733,13 +729,9 @@ export async function runTasks(params, ...taskList) { // Run the task: let result = null; - try { - // eslint-disable-next-line no-await-in-loop - result = await task.call(this, prevResults, i); - } catch (error) { - // eslint-disable-next-line no-console - console.error(error); - } + // eslint-disable-next-line no-await-in-loop + result = await task.call(this, prevResults, i); + if (!task.name.length) { // eslint-disable-next-line no-console console.warn("The task doesn't have a name. Please use a named function to create the task.");