diff --git a/whalesong/js-assembler/runtime-src/baselib-functions.js b/whalesong/js-assembler/runtime-src/baselib-functions.js index d2e0045..1d2741e 100644 --- a/whalesong/js-assembler/runtime-src/baselib-functions.js +++ b/whalesong/js-assembler/runtime-src/baselib-functions.js @@ -101,8 +101,7 @@ (succ || function () {}).apply(null, arguments); }; var wrappedFail = function(err) { - releaseLock(); - (fail || function () {})(err); + (fail || function () {})(err); }; if (!(baselib.arity.isArityMatching(v.racketArity, args.length - 2))) { var msg = baselib.format.format( @@ -159,8 +158,9 @@ MACHINE.v = oldVal; MACHINE.a = oldArgcount; MACHINE.p = oldProc; + // The lock is released by _trampoline in this case. wrappedFail(e); - }; + }; MACHINE._trampoline(v.label, false, releaseLock); }); diff --git a/whalesong/js-assembler/runtime-src/runtime.js b/whalesong/js-assembler/runtime-src/runtime.js index 6249729..572ad42 100644 --- a/whalesong/js-assembler/runtime-src/runtime.js +++ b/whalesong/js-assembler/runtime-src/runtime.js @@ -908,7 +908,7 @@ var i; machine = machine || runtime.currentMachine; for (i = 0; i < machine.mainModules.length; i++) { - var ns = machine.modules[mainModules[i]].getExternalExports(); + var ns = machine.modules[machine.mainModules[i]].getExternalExports(); if(ns.hasKey(name)) { return ns.get(name); }