This produces a reference error in Firefox. Examining the compiled JS file, we can see that neither ProcA as 'f_proca' or ProcB as 'f_procb' are in the code.
SpiderBasic should either compile all the procedures defined, or make this customisable.
Hi Peter,
I thought so, but I really believe that this should be customisable. Interacting with third party libraries would be a lot easier. In Go, for example, declaring but not using a function is considered a compiler error. If SB has inline JS support, it should really scan for at least procedure name mentions in lines starting with an exclamation mark.
Optimisation is good, as long as it does not affect the user experience. If I know that my code does not have unused procedures, I do not need this kind of optimisation. PureBasic, for example, does this with variable bounds checking, etc. Please, Fred, make this an option that we can set in Compiler Options, for example 'Remove unused functions', or something similar.