While experimenting with ways to implement a more dynamic dispatch, I
encountered some unexpected behavior regarding catching exceptions.
Raising an exception from within $setresolver works correctly, unless
an undefined field is accessed within a try block in which case an
"Invalid Trap" exception is raised.
$setresolver(function(object, field) {
$throw("Invalid dispatch");
});
try
$new(null).foo()
catch e {
$print("Caught: ", e, "\n");
}
Even worse, defining $setresolver to return a function which raises
an exception will result in a Bus Error.
$setresolver(function(object, field) {
function() { $throw("Invalid dispatch"); };
});
This is on Neko 1.5.2 built from source Mac OS X 10.4.8 PPC.
-Justin
--
Neko : One VM to run them all
(http://nekovm.org)