> I assume you mean m.load("la1").
No, that doesn't follow James's example at all. I'm not sure what you're
talking about here.
> So what is the behavior if you do new m.load("la1").Foo() if you know Foo is
> an exported object?
I'm not really sure what you're asking here either.
> Is there a module API that allows one to introspect a modules content?
Yes, very easily -- modules can be reflected as first-class objects. Whenever a
module is in scope, you can simple refer to it in an expression and you get an
object whose properties are the exports of the module. For example:
module M {
export var foo = 42;
export function bar() { return foo; }
}
var obj = M;
alert(Object.getOwnPropertyNames(obj)); // "foo, bar"
Dave
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss