1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-08 19:56:39 +00:00

fix: variables in functions should not pollute upstream widgets

This commit is contained in:
saqimtiaz 2024-09-27 21:36:22 +02:00
parent bb75560922
commit f343ccd337
2 changed files with 21 additions and 1 deletions

View File

@ -335,7 +335,7 @@ Widget.prototype.makeFakeWidgetWithVariables = function(variables) {
};
} else {
opts = opts || {};
opts.variables = $tw.utils.extend(variables,opts.variables);
opts.variables = $tw.utils.extend({},variables,opts.variables);
return self.getVariableInfo(name,opts);
};
},

View File

@ -0,0 +1,20 @@
title: Functions/FunctionFilterrunVariables4
description: Nested functions in filter runs that set variables should not pollute upstream widget tree
type: text/vnd.tiddlywiki-multiple
tags: [[$:/tags/wiki-test-spec]]
title: Output
\function .a() [.b[]]
\function .b() [all[]] :map[subtract[1].c[]]
\function .c() [all[]] :map[subtract[1].d[]]
\function .d() [all[]] :map[subtract[1].e[]]
\function .e() [all[]] :map[subtract[1]]
<$text text={{{ [[10]] :map:flat[.a[]then<currentTiddler>] }}}/>
+
title: ExpectedResult
10