public Scriptable registerExports(Context cx, Scriptable global, NodeRuntime runtime)
throws InvocationTargetException, IllegalAccessException, InstantiationException
{
Scriptable natives = cx.newObject(global);
ModuleRegistry registry = ((ScriptRunner)runtime).getRegistry();
for (String name : registry.getCompiledModuleNames()) {
Script script = registry.getCompiledModule(name);
String fileName = '/' + script.getClass().getName().replace(".", "/") + ".js";
InputStream in = script.getClass().getResourceAsStream(fileName);
if (in == null) {
continue;