From 7945c0e54f0b63adc062bf1734228220b3bfae22 Mon Sep 17 00:00:00 2001 From: nyne Date: Wed, 3 Sep 2025 20:31:42 +0800 Subject: [PATCH] Improve compute api. --- assets/init.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/assets/init.js b/assets/init.js index 7705a84..d4b503f 100644 --- a/assets/init.js +++ b/assets/init.js @@ -1428,14 +1428,14 @@ function getClipboard() { /** * Compute a function with arguments. The function will be executed in the engine pool which is not in the main thread. * @param func {string} - A js code string which can be evaluated to a function. The function will receive the args as its only argument. - * @param args {any[] | null | undefined} - The arguments to pass to the function. + * @param args {any[]} - The arguments to pass to the function. * @returns {Promise} - The result of the function. * @since 1.5.0 */ -function compute(func, args) { +function compute(func, ...args) { return sendMessage({ method: 'compute', function: func, args: args }) -} +} \ No newline at end of file