JSDoc Function Prototype

Questions, tips and tricks and techniques for scripting in Servoy

JSDoc Function Prototype

Postby kwpsd » Tue Mar 27, 2012 8:01 pm

We have many instances where we expand the functionality of standard JavaScript class types...for example:

Code: Select all
    // Replicate a string 'n' number of times

    String.prototype.replicate = function( n )
    {
        return new Array( isNaN( n ) ? 1 : n++ ).join( this )
    }


All prototypes generate a similar warning:

The property replicate is undefined for the javascript type String.


What is the proper way to annotate this using JSDocs to get rid of the warnings?
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: JSDoc Function Prototype

Postby kwpsd » Thu Mar 29, 2012 6:56 pm

Anyone? Servoy engineers (Paul, Johan, Joas, et al)?

I tried various combinations of the Servoy JSDoc tags to no avail. I need help with this!
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: JSDoc Function Prototype

Postby jcompagner » Fri Mar 30, 2012 9:39 am

no this doesn't work in the the editor. It works fine at runtime but the editor doesn't know about prototyping, we have no support yet where you could register prototypes so that we know you enhanced the standard objects
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: JSDoc Function Prototype

Postby kwpsd » Fri Mar 30, 2012 7:23 pm

Thanks for the explanation, Johan. Do I need to file a feature request for this, or is it already in the planning? If the latter, what is the expected release date?
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA

Re: JSDoc Function Prototype

Postby jcompagner » Sun Apr 01, 2012 5:19 pm

don't know if there is a specific feature request for that already, i know we talked about it
When it is released is not yet known, because it is not planned at the moment, also it is part of a 3th party lib we are using, not directly servoy's own code.
Johan Compagner
Servoy
User avatar
jcompagner
 
Posts: 8828
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: JSDoc Function Prototype

Postby kwpsd » Tue Apr 03, 2012 1:27 am

Request created: SVY-1949
Kim W. Premuda
San Diego, CA USA
User avatar
kwpsd
 
Posts: 687
Joined: Sat Jul 28, 2007 6:59 pm
Location: San Diego, CA USA


Return to Methods

Who is online

Users browsing this forum: No registered users and 13 guests