JSDoc Variable Warnings

Questions, tips and tricks and techniques for scripting in Servoy

JSDoc Variable Warnings

Postby Gordon McLean » Fri Aug 17, 2012 9:40 am

Hi

I am using a popup function and hence have a bit of code along the lines

Code: Select all
function onRightClickNoBooking(event) {
   var popupmenu = plugins.window.createPopupMenu()

   var menuitem1 = popupmenu.addMenuItem('Add', addRecord)
   var menuitem2 = popupmenu.addMenuItem('Show Notes',addBookingNotes)


The JSDocs are warning that the variables menuitem1, 2, 3 etc are not used. I have tried to insert the JSDoc flag @SuppressWarnings(unused) which is not working can anyone point me in the direction of the correct syntax to remove the warnings about these unused variables

Cheers
Gordon
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 253
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK

Re: JSDoc Variable Warnings

Postby Joas » Fri Aug 17, 2012 10:22 am

You are not using those variables, so why do you define them?

Try this instead:
Code: Select all
function onRightClickNoBooking(event) {
   var popupmenu = plugins.window.createPopupMenu()

   popupmenu.addMenuItem('Add', addRecord)
   popupmenu.addMenuItem('Show Notes',addBookingNotes)
Joas de Haan
Yield Software Development
Need help on your project? yieldsd.com
User avatar
Joas
Site Admin
 
Posts: 842
Joined: Mon Mar 20, 2006 4:07 pm
Location: Leusden, NL

Re: JSDoc Variable Warnings

Postby Gordon McLean » Fri Aug 17, 2012 12:57 pm

Good point ! sorry to waste the bandwidth :(
Gordon McLean
Clickdigital.com
Gordon McLean
 
Posts: 253
Joined: Wed Aug 03, 2005 12:24 pm
Location: UK


Return to Methods

Who is online

Users browsing this forum: No registered users and 15 guests

cron