Module system strawpersons

Kam Kasravi kamkasravi at yahoo.com
Mon Jan 18 16:48:46 PST 2010


So A.bar() would be a function A with a function bar attached.
I believe Ihab's proposal allows this.

In order to satisfy something like
(import B).foo() 
the browser would need to import B prior to reaching this statement 
or suspend execution at the '.' so the resources could be fetched.
I believe we're talking about the former - getting all resources early.




________________________________
From: Andy Chu <andy at chubot.org>
To: Kam Kasravi <kamkasravi at yahoo.com>
Cc: mikesamuel at gmail.com; kkasravi <kkasravi at me.com>; Brendan Eich <brendan at mozilla.com>; es-discuss <es-discuss at mozilla.org>
Sent: Mon, January 18, 2010 4:02:09 PM
Subject: Re: Module system strawpersons

On Mon, Jan 18, 2010 at 2:24 PM, Kam Kasravi <kamkasravi at yahoo.com> wrote:
> Hi Mike
>
> The former but not in the way you've described. Rather
>
> module A:
> this.getB= function() {
>   return new (import 'B')();
> }
>
> module B:
> this.getA = function() {
>   return new (import 'A')();
> }

In CommonJS, this doesn't seem like a special problem.  The imports
are not executed until the functions are called, so everything is
dandy.  I was referring to this situation:

module A:
import B

B.foo()

module B:
import A

A.bar()

Do the given proposals allow or disallow this?

Andy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20100118/8b46d5f9/attachment.html>


More information about the es-discuss mailing list