test cases appear to be running again

This commit is contained in:
Danny Yoo 2011-09-06 14:33:22 -04:00
parent 55ca576a43
commit f39b192fee
4 changed files with 26 additions and 20 deletions

View File

@ -267,16 +267,14 @@ MACHINE.modules[~s] =
(") (")
(assemble/write-invoke stmts op) (assemble/write-invoke stmts op)
(fprintf op ")(MACHINE, (fprintf op ")(MACHINE,
function() { function() {
if (window.console && window.console.log) { if (window.console && window.console.log) {
window.console.log('loaded ' + ~s); window.console.log('loaded ' + ~s);
} }
plt.runtime.setReadyTrue(); plt.runtime.setReadyTrue();
}, },
function(err) { FAIL,
alert(err.message) PARAMS);
},
PARAMS);
});\n" });\n"
(format "~a" (source-name src))) (format "~a" (source-name src)))
(define stop-time (current-inexact-milliseconds)) (define stop-time (current-inexact-milliseconds))
@ -289,8 +287,11 @@ MACHINE.modules[~s] =
(define (on-last-src) (define (on-last-src)
(fprintf op "plt.runtime.setReadyTrue();") (fprintf op "plt.runtime.ready(
(fprintf op "SUCCESS();")) function() {
plt.runtime.setReadyTrue();
SUCCESS();
});"))
(define packaging-configuration (define packaging-configuration
@ -310,7 +311,7 @@ MACHINE.modules[~s] =
(fprintf op "var invoke = (function(MACHINE, SUCCESS, FAIL, PARAMS) {") (fprintf op "var invoke = (function(MACHINE, SUCCESS, FAIL, PARAMS) {")
(fprintf op " plt.runtime.ready(function() {") (fprintf op " plt.runtime.ready(function() {")
(fprintf op "plt.runtime.setReadyFalse();") (fprintf op " plt.runtime.setReadyFalse();")
(make (list (make-MainModuleSource source-code)) (make (list (make-MainModuleSource source-code))
packaging-configuration) packaging-configuration)
(fprintf op " });"); (fprintf op " });");

View File

@ -585,7 +585,7 @@
// setReadyTrue is called. // setReadyTrue is called.
var ready, setReadyTrue, setReadyFalse; var ready, setReadyTrue, setReadyFalse;
(function() { (function() {
var runtimeIsReady = false; var runtimeIsReady = true;
var readyWaiters = []; var readyWaiters = [];
var notifyWaiter = function(w) { var notifyWaiter = function(w) {
w(); w();

View File

@ -42,8 +42,12 @@ return (function(succ, fail, params) {
} }
}; };
return innerInvoke(machine, return innerInvoke(machine,
function() { plt.runtime.invokeMains(machine, succ, fail); }, function() {
function(MACHINE, e) { fail(e); }, plt.runtime.invokeMains(machine, succ, fail);
},
function(MACHINE, e) {
return fail(e);
},
myParams); myParams);
}); });
}); });

View File

@ -26,11 +26,12 @@
(fprintf op #<<EOF (fprintf op #<<EOF
return (function(succ, fail, params) { return (function(succ, fail, params) {
var myParams = { currentDisplayer: function(MACHINE, v) { params.currentDisplayer(v); }}; var machine = new plt.runtime.Machine();
return innerInvoke(new plt.runtime.Machine(), machine.params.currentDisplayer =
function(MACHINE, v) { params.currentDisplayer(v); };
return innerInvoke(machine,
succ, succ,
function(MACHINE, exn) { fail(exn); }, function(MACHINE, exn) { return fail(exn); });
myParams);
}); });
}); });
EOF EOF