simple modules

Dave Herman dherman at mozilla.com
Sat Jan 30 09:46:13 PST 2010


I'll add an example demonstrating modules with shared state; if you want to make a point about the consequences of this, I'm happy to discuss.

WRT isolation, Sam and I have some thoughts about a largely orthogonal proposal for providing isolation without needing to impose restrictions on the semantics of modules. I will ping the list as soon as that's ready.

Thanks,
Dave

----- Original Message -----
From: "ihab awad" <ihab.awad at gmail.com>
To: "David Herman" <dherman at mozilla.com>
Cc: es-discuss at mozilla.org
Sent: Friday, January 29, 2010 8:59:09 PM
Subject: Re: simple modules

Hi Dave & Sam,

Could you please add to your examples the following case: a module
which keeps an internal counter of how many times one of its methods
is called. In other words, in the body of the module, there is
something like:

    var i = 0;
    export function get() { return i++; }

Could you also please add an example where the variable "i" is
initialized to a value supplied by the module importer?

Ihab

-- 
Ihab A.B. Awad, Palo Alto, CA


More information about the es-discuss mailing list