`this` if the global object is not in the scope chain?

Axel Rauschmayer axel at rauschma.de
Tue Mar 19 19:09:32 PDT 2013

Right, my bad. You could do:

    export let foo = this;

    export let bar = doSomethingWithThis(this);

On Mar 20, 2013, at 2:48 , Kevin Smith <khs4473 at gmail.com> wrote:

> But in modules, you are never in global scope and always in strict mode. Hence, I don’t see a way to access the global object in the above manner (or in any other manner, unless it refers to itself).
> |this| in a module still refers the the "global" object, whatever that may be in the context of the current loader.  It *could* be `window`, or not.
> { Kevin }

Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130320/603a4de5/attachment.html>

More information about the es-discuss mailing list