title: WARNING - dangerous use of the global this object
body: <p>In Google Closure Compiler I get the warning</p>
  
  <blockquote>
    <p>WARNING - dangerous use of the global this object</p>
  </blockquote>
  
  <p>Here is an example. The error line and offset refers to the beginning of the word <code>this</code></p>
  
  <pre><code>function aToggle() {
    if(shown)
      toggle.show()
    else
      toggle.hide()
    $(this).text(shown ? 'Click to hide' : 'Click to show')
    shown = !shown
  }
  link.onclick = aToggle
  </code></pre>
  
  <p>I would just change it to an anonymous method, but I am re-using <code>aToggle</code> elsewhere in the file, so it needs to be named.</p>
  
  <p>I could mark <code>aToggle</code> as <code>/**@constructor*/</code> -- but it is not a constructor. Is there another annotation I can use to eliminate this warning, or am I stuck between marking it as constructor or having a bunch of useless warnings show up?</p>