The object methods work fine, but the JSDoc (or lack thereof) is generating a warning (100’s in my case) every time the object’s methods are used. The warning message is:
Call to something which is not known to be a function
In Developer, when I reference the object, IntelliSense/Autocomplete shows the function as a property, not a function.
What is the best way to JSDoc annotate object functions in order to eliminate the warnings?
Adding the JSDoc annotation to the object’s methods does not get rid of the warnings (I tried with and without the annotation). When adding the annotation, I used the ALT-SHIFT-J method just to make certain it was being added correctly. The warnings are at the instance of the object’s usage, not in the object itself. For example,
var x = scopes.globals.objectName.functionName()
emits the warning (even though the function works).
Our solution has many modules of which one is a ‘core’ module. The declaration of the _oSystem object as well as the class definiton of the object are in the ‘core’ module.
/**
* @properties={typeid:35,uuid:"85A98ABB-29CD-4E16-BAC3-6E94EB301B79",variableType:-4}
*/
var _oSystem = {};
Thinking that this could be the cause of the warnings, the object ‘type’ was removed altogether, but it did not make a difference. I tried your ‘type’ suggestion as well (copied it verbatim), but, it too, did not make any difference.
The global object is declared in the core module using the ‘add variable’ method for that module and selecting ‘media’ type (just as you show it). The object class is in the same core module.
I vaguely recall seeing something in the referenced JSDoc links in the Servoy wiki about a ‘@method’ type, but I do not believe Servoy supports this. Do you have any other suggestions…perhaps, a way to turn off this warning?