How to escape implicit 'with (this)' of a method body

Michael Haufe TNO at TheNewObjective.com
Mon Jul 28 15:22:03 PDT 2008


/function foo () { return 'global'; }

class bar {
   function foo () { return 'local'; }

   function zot () {
     // How can I call the global foo from here?
     without (this) { foo(); }
   }
}/



You could use window["foo"](); or whatever the global object is named in 
the environment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.mozilla.org/pipermail/es-discuss/attachments/20080728/c9caa411/attachment-0002.html 


More information about the Es4-discuss mailing list