the exception handler consumes both the exception and the machine.
This commit is contained in:
parent
7c7491329c
commit
e5ff0e227c
|
@ -26,8 +26,8 @@
|
||||||
(displayln (assemble-basic-block basic-block) op)
|
(displayln (assemble-basic-block basic-block) op)
|
||||||
(newline op))
|
(newline op))
|
||||||
basic-blocks)
|
basic-blocks)
|
||||||
(fprintf op "MACHINE.params.currentErrorHandler = function(e) { fail(e); };\n")
|
(fprintf op "MACHINE.params.currentErrorHandler = fail;\n")
|
||||||
(fprintf op "MACHINE.params.currentSuccessHandler = function(MACHINE) { success(MACHINE.val); };\n")
|
(fprintf op "MACHINE.params.currentSuccessHandler = success;\n")
|
||||||
(fprintf op #<<EOF
|
(fprintf op #<<EOF
|
||||||
for (param in params) {
|
for (param in params) {
|
||||||
if (params.hasOwnProperty(param)) {
|
if (params.hasOwnProperty(param)) {
|
||||||
|
|
|
@ -309,8 +309,8 @@ var MACHINE = { callsBeforeTrampoline: 100,
|
||||||
running : false,
|
running : false,
|
||||||
params: { currentDisplayer: function(v) {},
|
params: { currentDisplayer: function(v) {},
|
||||||
|
|
||||||
currentSuccessHandler: function(v) {},
|
currentSuccessHandler: function(MACHINE) {},
|
||||||
currentErrorHandler: function(e) {},
|
currentErrorHandler: function(MACHINE, exn) {},
|
||||||
|
|
||||||
currentNamespace: {},
|
currentNamespace: {},
|
||||||
|
|
||||||
|
@ -379,7 +379,7 @@ var trampoline = function(MACHINE, initialJump) {
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
MACHINE.running = false;
|
MACHINE.running = false;
|
||||||
return MACHINE.params.currentErrorHandler(e);
|
return MACHINE.params.currentErrorHandler(MACHINE, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user