bug 238324 - Implement JavaScript code-sharing module system
Basically it lets you do something like:
in foo.js:
Code: Select all
function fun() {
...
}
in bar.js:
Code: Select all
Components.utils.importModule('foo.js')
fun();
The difference between this and using a subscript loader solution is that foo.js will only be loaded and evaluated once no matter how many times it's imported. Way cool! Hopefully this will land on trunk soon.