Rick Waldron (2013-07-10T23:24:44.000Z)
On Wed, Jul 10, 2013 at 7:15 PM, Andrew Fedoniouk <news at terrainformatica.com
> wrote:

> Consider this simple construct:
>
> module "test" {
>     export function setVar() {
>         gvar = "GVAR";               // note 'gvar' is not defined in the
> module
>     }
>     export function getVar() {
>         return gvar;
>     }
> }
>
> module Test from "test";


> Having this in place I am calling
>
> Test.setVar();
>
> Question: where is that 'gvar' created? Possible case:
>
> a. {{globalns}}.gvar == "GVAR"   // so in global namespace or
> b. {{globalns}}.Test.gvar == "GVAR" // in module namepspace
>
> In other words does the module establish its own dynaimic namespace/scope?
>
> If that behavior is spec'ed already I'll appreciate for the link.
>

It gets created nowhere, because the body of a module is implicitly strict,
so the above code produces a Reference Error.

Rick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20130710/c5d28b48/attachment.html>
domenic at domenicdenicola.com (2013-07-13T01:03:31.096Z)
It gets created nowhere, because the body of a module is implicitly strict, so the above code produces a Reference Error.