diff --git a/core/modules/widgets/widget.js b/core/modules/widgets/widget.js index eb84fab4a..b73294654 100755 --- a/core/modules/widgets/widget.js +++ b/core/modules/widgets/widget.js @@ -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); }; }, diff --git a/editions/test/tiddlers/tests/data/functions/FunctionFilterrunVariables4.tid b/editions/test/tiddlers/tests/data/functions/FunctionFilterrunVariables4.tid new file mode 100644 index 000000000..d78b211ad --- /dev/null +++ b/editions/test/tiddlers/tests/data/functions/FunctionFilterrunVariables4.tid @@ -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] }}}/> + ++ +title: ExpectedResult + +10 \ No newline at end of file