New shutdownWorld action
This commit is contained in:
parent
0054254aed
commit
c57833938a
|
@ -118,6 +118,10 @@ function sendMessage(m, metaLevel, isFeedback) {
|
|||
isFeedback: (isFeedback === undefined) ? false : isFeedback };
|
||||
}
|
||||
|
||||
function shutdownWorld() {
|
||||
return { type: "shutdownWorld" };
|
||||
}
|
||||
|
||||
/*---------------------------------------------------------------------------*/
|
||||
/* Metafunctions */
|
||||
|
||||
|
@ -218,6 +222,10 @@ World.exit = function (exn) {
|
|||
World.current().killActive(exn);
|
||||
};
|
||||
|
||||
World.shutdownWorld = function () {
|
||||
World.current().enqueueAction(shutdownWorld());
|
||||
};
|
||||
|
||||
World.withWorldStack = function (stack, f) {
|
||||
var oldStack = World.stack;
|
||||
World.stack = stack;
|
||||
|
@ -373,6 +381,9 @@ World.prototype.performAction = function (pid, action) {
|
|||
World.send(action.message, action.metaLevel - 1, action.isFeedback);
|
||||
}
|
||||
break;
|
||||
case "shutdownWorld":
|
||||
World.exit();
|
||||
break;
|
||||
default:
|
||||
throw { message: "Action type " + action.type + " not understood",
|
||||
action: action };
|
||||
|
|
Loading…
Reference in New Issue