About TrimPath stuff, like Junction, Next Action, JavaScript Templates, TrimQuery, TrimSpreadsheet, etc...
You are not logged in.
I suppose that here should have been the first place to ask, rather then just posting an issue.
Could someone take a look at this and confirm whether they get the same issue:
http://code.google.com/p/trimpath/issue … &can=1
The included test page, for me, produces output like this:
Zero outside of a macro: 0
Zero inside a macro:
I'd have expected a second 0 after the second line.
Offline
Right, I think I've got to the bottom of it.
In the process function for processing templates, the output function is defined on line 138 as such:
var resultOut = { write: function(m) { resultArr.push(m); } };But for macros, the output function is defined on line 111 as:
var _OUT = { write: function(m) { if (m) _OUT_arr.push(m); } };So any values that evaluate as false never get written.
I'd suggest that the "if (m)" needs to get removed from line 111. It could be replaced by if(defined(m)) or if (m != null), but IMHO it should be consistent with behaviour outside of a macro.
Offline