fixing issues with main modules.

This commit is contained in:
Danny Yoo 2013-03-27 16:05:06 -06:00
parent f2c2b540fd
commit 569058c2f2
2 changed files with 5 additions and 4 deletions

View File

@ -186,7 +186,7 @@
[(AliasModuleAsMain!? op)
(format "M.mainModules.push(M.modules[~s]);"
(format "M.mainModules.push(~s);"
(symbol->string (ModuleLocator-name (AliasModuleAsMain!-from op))))]
[(FinalizeModuleInvokation!? op)

View File

@ -823,8 +823,9 @@
var mainModules = machine.mainModules.slice();
var loop = function() {
if (mainModules.length > 0) {
var nextModule = mainModules.shift();
nextModule.invoke(machine, loop, fail);
var nextModuleName = mainModules.shift();
machine.modules[nextModuleName] = machine.installedModules[nextModuleName]();
machine.modules[nextModuleName].invoke(machine, loop, fail);
} else {
setReadyTrue();
succ();
@ -839,7 +840,7 @@
var i;
machine = machine || runtime.currentMachine;
for (i = 0; i < machine.mainModules.length; i++) {
var ns = machine.mainModules[i].getExports();
var ns = machine.modules[mainModules[i]].getExternalExports();
if(ns.hasKey(name)) {
return ns.get(name);
}