From 79536e48751c9ee3f8939531ff651bb5b5b950d5 Mon Sep 17 00:00:00 2001 From: "S. Elliott Johnson" Date: Fri, 5 Jan 2024 17:28:24 -0700 Subject: [PATCH] document function --- packages/svelte/src/internal/client/runtime.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 4bf8d7806f..168f59380b 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -1974,6 +1974,12 @@ export function thunkspread(iterable) { } /** + * This is meant to proxy the `...rest` parameter to a snippet function. Basically, + * this array will be full of functions that need to be invoked to unwrap their value. + * We have no way of forcing that invocation in all circumstances -- for example, if + * a user passes the rest array to a function that then accesses it via `rest[0]`, we + * would need to transform that into `rest[0]()`. That's effectively what this proxy does. + * * @template {unknown[]} T * @param {T} items * @returns {T}