From 683414f51ee440f3c4451efaa3425174a33f3afd Mon Sep 17 00:00:00 2001 From: "jeremy@jermolene.com" Date: Mon, 23 Jan 2023 16:34:08 +0000 Subject: [PATCH] Fix positional parameters in widget.evaluateVariable() This should clear up the remaining anomalies in #7009, let me know how you get on @btheado --- core/modules/widgets/widget.js | 21 +++++-------- .../Parameterised-Positional-Variables.tid | 30 +++++++++++++++++++ 2 files changed, 38 insertions(+), 13 deletions(-) create mode 100644 editions/test/tiddlers/tests/data/transclude/Parameterised-Positional-Variables.tid diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index aff1b0e8b..741914fdc 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -172,8 +172,8 @@ Widget.prototype.getVariable = function(name,options) { /* Maps actual parameters onto formal parameters, returning an array of {name:,value:} objects -formalParams - {name:,default:} (default value is optional) -actualParams - {name:,value:} (name is optional) +formalParams - Array of {name:,default:} (default value is optional) +actualParams - Array of string values or {name:,value:} (name is optional) */ Widget.prototype.resolveVariableParameters = function(formalParams,actualParams) { formalParams = formalParams || []; @@ -187,7 +187,7 @@ Widget.prototype.resolveVariableParameters = function(formalParams,actualParams) paramInfo = formalParams[p]; paramValue = undefined; for(var m=0; m] +\define mymacro(alpha:"apple",beta:"banana",gamma:"grenadine") $beta$ +\function f(a) [] + +(Functions: +<$text text={{{ [] }}}/> +, +<$text text=<>/> +, +<> +)(Macros: +<$text text={{{ [] }}}/> +, +<$text text=<>/> +, +<> +) + ++ +title: ExpectedResult + +

(Functions:f1,f1,f1)(Macros:banana,banana,banana)

\ No newline at end of file