Caridy Patino (2014-06-09T16:40:56.000Z)
another issue with `this` being `global` (as it is today by the specs) is
the way top level modules will be defined in a page, assuming we will have
`type="module"` for scripts (which is probably were we want to be), what
will be the difference between:

<script type="module">
this.foo = 1;
var bar = 2;
import main from "main";
</script>

and

<script>
this.foo = 1;
var bar = 2;
System.import("main");
</script>

it seems to me that the current definition, where `this` is `global`, will
be an issue when it comes to avoid global variable definition. Ideally, for
modules, `this.foo` and `bar` will be contained, to have a clear
differentiation with the regular `script` tags.

/caridy


On Mon, Jun 9, 2014 at 12:27 PM, Kevin Smith <zenparsing at gmail.com> wrote:

>
> The genuine global is typically the source of tremendous amounts of
>> authority. Much of the mechanism of SES is built to deny access to the
>> genuine global and to non-whitelisted global variables. Can the module
>> loader API be used to load a module with a different top level binding for
>> "this"?
>>
>
> IIUC, that use case is provided for with custom module loaders (where you
> can specify the realm and such).
>
>
>
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20140609/7e8fc02d/attachment.html>
domenic at domenicdenicola.com (2014-06-12T22:27:10.755Z)
another issue with `this` being `global` (as it is today by the specs) is
the way top level modules will be defined in a page, assuming we will have
`type="module"` for scripts (which is probably were we want to be), what
will be the difference between:

```html
<script type="module">
this.foo = 1;
var bar = 2;
import main from "main";
</script>
```

and

```html
<script>
this.foo = 1;
var bar = 2;
System.import("main");
</script>
```

it seems to me that the current definition, where `this` is `global`, will
be an issue when it comes to avoid global variable definition. Ideally, for
modules, `this.foo` and `bar` will be contained, to have a clear
differentiation with the regular `script` tags.