javascript - How to annotate anonymous object with optional property in JSDoc -


i have javascript class takes 1 argument of type object defined set of properties , closure compiler happy when annotate like:

@constructor @param {{ subview:baseview, el:(jquery|element), title:string }} options var myview = function(options){ } 

i make title key optional , pass title value instances of class , implement fallback behavior when key not present, annotated class with:

@constructor @param {{ subview:baseview, el:(jquery|element), title:string= }} options var myview = function(options){ } 

and closure compiler complaining:

warning - bad type annotation. expected closing } 

i've checked annotating javascript closure compiler, see no single line describing such use case.

@param {{ subview:baseview, el:(jquery|element), title:(string|undefined) }} options


Comments

Popular posts from this blog

javascript - how to protect a flash video from refresh? -

android - Associate same looper with different threads -

visual studio 2010 - Connect to informix database windows form application -