From ed7763df921fa2cc6787adefdc92ac22568445dc Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sat, 25 Feb 2023 14:13:39 +0100 Subject: [PATCH] fix: reify after sequence to preserve array ref https://github.com/tidalcycles/strudel/issues/383#issuecomment-1399514090 --- packages/core/pattern.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/pattern.mjs b/packages/core/pattern.mjs index 1274e760..f8213380 100644 --- a/packages/core/pattern.mjs +++ b/packages/core/pattern.mjs @@ -1632,7 +1632,6 @@ export function register(name, func) { }; Pattern.prototype[name] = function (...args) { - args = args.map(reify); // For methods that take a single argument (plus 'this'), allow // multiple arguments but sequence them if (arity === 2 && args.length !== 1) { @@ -1640,6 +1639,7 @@ export function register(name, func) { } else if (arity !== args.length + 1) { throw new Error(`.${name}() expects ${arity - 1} inputs but got ${args.length}.`); } + args = args.map(reify); return pfunc(...args, this); };