continuing to push the cps-ing through
This commit is contained in:
parent
764afaa731
commit
4e8b8a64cd
|
@ -1207,40 +1207,37 @@
|
||||||
|
|
||||||
onCleanRestart = function() {
|
onCleanRestart = function() {
|
||||||
running = false;
|
running = false;
|
||||||
stopEventHandlers();
|
stopEventHandlers(
|
||||||
restart(function(MACHINE) {
|
function() {
|
||||||
MACHINE.params.currentOutputPort = oldOutputPort;
|
restart(function(MACHINE) {
|
||||||
currentBigBangRecord = oldCurrentBigBangRecord;
|
MACHINE.params.currentOutputPort = oldOutputPort;
|
||||||
finalizeClosureCall(MACHINE, world);
|
currentBigBangRecord = oldCurrentBigBangRecord;
|
||||||
});
|
finalizeClosureCall(MACHINE, world);
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
onMessyRestart = function(exn) {
|
onMessyRestart = function(exn) {
|
||||||
running = false;
|
running = false;
|
||||||
stopEventHandlers();
|
stopEventHandlers(
|
||||||
restart(function(MACHINE) {
|
function() {
|
||||||
currentBigBangRecord = oldCurrentBigBangRecord;
|
restart(function(MACHINE) {
|
||||||
MACHINE.params.currentOutputPort = oldOutputPort;
|
currentBigBangRecord = oldCurrentBigBangRecord;
|
||||||
plt.baselib.exceptions.raise(MACHINE, exn);
|
MACHINE.params.currentOutputPort = oldOutputPort;
|
||||||
});
|
plt.baselib.exceptions.raise(MACHINE, exn);
|
||||||
|
});
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
startEventHandlers = function(k) {
|
startEventHandlers = function(k) {
|
||||||
var i;
|
forEachK(startEventHandler, eventHandlers, k);
|
||||||
for (i = 0; i < eventHandlers.length; i++) {
|
|
||||||
startEventHandler(eventHandlers[i]);
|
|
||||||
}
|
|
||||||
k();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
stopEventHandlers = function() {
|
stopEventHandlers = function(k) {
|
||||||
var i;
|
forEachK(stopEventHandler, eventHandlers, k);
|
||||||
for (i = 0; i < eventHandlers.length; i++) {
|
|
||||||
stopEventHandler(eventHandlers[i]);
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
startEventHandler = function(handler) {
|
startEventHandler = function(handler, k) {
|
||||||
var fireEvent = function(who) {
|
var fireEvent = function(who) {
|
||||||
if (! running) { return; }
|
if (! running) { return; }
|
||||||
var args = [].slice.call(arguments, 1);
|
var args = [].slice.call(arguments, 1);
|
||||||
|
@ -1259,10 +1256,12 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
handler.eventSource.onStart(fireEvent);
|
handler.eventSource.onStart(fireEvent);
|
||||||
|
k();
|
||||||
};
|
};
|
||||||
|
|
||||||
stopEventHandler = function(handler) {
|
stopEventHandler = function(handler, k) {
|
||||||
handler.eventSource.onStop();
|
handler.eventSource.onStop();
|
||||||
|
k();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user