Syntax error if only comments in function node On Stop

A minor issue with node-red 1.3.4, if the On Stop tab of a Function node consists of only comments (after the default header text there) then on passing the node a message the error
SyntaxError: Unexpected end of input (cleanup:line 17)
appears in the debug pane.

To replicate this add a new function node and add just a comment line to the On Stop tab, and feed it with an Inject node.

It may seem that this is a pointless thing to do, but it bit me when I was experimenting with On Stop code and commented it all out as a test. To get the node to run I had to completely delete the On Stop contents.

Thanks @Colin

When it's something as reproducible as that, please do go ahead and raise an issue on github if you want.

Although no need this time as I've just pushed the fix.

1 Like

Great, thanks.

I am never sure when I should report something here and when to just submit an issue.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.