Nested modules clarification

Sam Tobin-Hochstadt samth at ccs.neu.edu
Wed Jul 18 04:25:55 PDT 2012


On Wed, Jul 18, 2012 at 2:37 AM, ๏̯͡๏ Jasvir Nagra <jas at nagras.com> wrote:
>
>
> On Tue, Jul 17, 2012 at 11:21 PM, David Herman <dherman at mozilla.com> wrote:
>>
>> On Jul 17, 2012, at 9:17 PM, ๏̯͡๏ Jasvir Nagra wrote:
>>
>> However, Module Semantics
>> (http://wiki.ecmascript.org/doku.php?id=harmony:modules_semantics) suggests
>> that each inline module declaration introduces a fresh scope.
>>
>>
>> As in, a fresh *nested* scope.
>
>
> Ah that was definitely not clear to me from reading the spec or the
> examples.  What outer bindings can be referred to - any lexically scoped
> variables or just other module definitions?

Lexical bindings as well as module definitions:

module outer {
  let x = 1;
  export module inner {
    export y = x + 2;
  }
}

-- 
sam th
samth at ccs.neu.edu


More information about the es-discuss mailing list