import/export

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

import/export

Niklas Lindquist
Hi
I'm using SM1.5 and need to be able to import some common code libs.

I #define'd JS_HAS_EXPORT_IMPORT 1, but  I get reference errors when
importing. Is this construct supported at all? Do I have to manually load
all possible external js-files?
Is it possible to hook this in my embedding to load the correct file?

The only idea I can come up with, is to supply another mechanism for
importing, such as a call to a native function
include( 'file1' );
include( 'file2' );

A bit ugly though. I also need to be able to set the search path for
imported scripts, but that won't be a problem if I can hook import construct
(or use the include() above)

Another though about include() is that I will be able to import js code
snippets anywhere in a script, which I beleive is not the idea of 'import'.
Pretty much like a macro. I'm not sure this is good or bad though.

Please advise.

/Niklas


_______________________________________________
mozilla-jseng mailing list
[hidden email]
http://mail.mozilla.org/listinfo/mozilla-jseng