diff --git a/core/modules/widgets/let.js b/core/modules/widgets/let.js index afd3a2f20..2b2886530 100644 --- a/core/modules/widgets/let.js +++ b/core/modules/widgets/let.js @@ -53,7 +53,9 @@ LetWidget.prototype.computeAttributes = function() { name = attribute.name; // Now that it's prepped, we're allowed to look this variable up // when defining later variables - self.currentValueFor[name] = value; + if(value !== undefined) { + self.currentValueFor[name] = value; + } }); // Run through again, setting variables and looking for differences $tw.utils.each(this.currentValueFor,function(value,name) { diff --git a/editions/test/tiddlers/tests/data/widgets/LetWidgetUndefinedVariable.tid b/editions/test/tiddlers/tests/data/widgets/LetWidgetUndefinedVariable.tid new file mode 100644 index 000000000..e6163d915 --- /dev/null +++ b/editions/test/tiddlers/tests/data/widgets/LetWidgetUndefinedVariable.tid @@ -0,0 +1,15 @@ +title: Widgets/LetWidgetUndefinedVariable +description: Test let widget undefined variable +type: text/vnd.tiddlywiki-multiple +tags: [[$:/tags/wiki-test-spec]] + +title: Output + +\whitespace trim +<$let test1=<> test2={{{ [] }}}> +<> + ++ +title: ExpectedResult + +

\ No newline at end of file