V5.3.0-prerelease - final checks - undefined function in a filter creates RSOD

I am getting a serious error in the prerelease, when I edit a function and there is code that references an undefined function.

I will return when I have an example to share and edit this reply.

# Internal JavaScript Error

Well, this is embarrassing. It is recommended that you restart TiddlyWiki by refreshing your browser

uncaught exception: Linked List only accepts string values, not undefined

On the prerelease site place this in a tiddler

\function list.top-toc() [tag[TableOfContents]]

{{{ [llist.top-toc[]] }}}

This will produce a list of tiddlers with the tag TableOfContents

Now edit the name of the function and as soon as you do, if you have the output preview active, you get the aforementioned error in a red box.

  • Otherwise the error occurs on done and the tiddler is displayed.
1 Like

Thank you. It seems like any usage of an non-existent function will create the error:

{{{ [doesnot.exist[]] }}}

And the issue is if the preview is open a single character edit causes it and disrupts the wikis operation, although not always destructively.

I have created a bug report that also contains an associated backwards compatibility concern: [BUG] Any usage of an undefined function in a filter triggers a red Internal JavaScript Error popup · Issue #7566 · Jermolene/TiddlyWiki5 · GitHub

Thanks @TW_Tones that’s very helpful. I’ve pushed a fix that should be available on the prerelease in a few minutes.

2 Likes

Using a misnamed or undefined function no longer causes the RSOD, thanks, but returning a list of all tiddlers is the outcome, perhaps it would be better returning nothing, if this was used as an input to a complex list, it could take a long time to render the full list, when a nul list would be sufficient to indicate a bad name.

  • Just a thought

An undefined function then falls back to regular handling as a field lookup.

For example, the filter [doesnot.exist[]] returns all tiddlers without the field doesnot.exist or where that field has an empty value. This behaviour cannot be changed due to backwards compatibility constraints.

1 Like