On 2008-07-28, at 18:22EDT, Michael Haufe wrote:

> /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

Shouldn't there be an es4 standard way of doing it, without relying on  
a particular environment?

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

  // I guess this should work, but it seems rather kludgey
  static function globalfoo (...) { return foo(...); }
  function zot () {
    globalfoo();
}
_______________________________________________
Es4-discuss mailing list
Es4-discuss@mozilla.org
https://mail.mozilla.org/listinfo/es4-discuss

Reply via email to