#!perl
use strict;
use warnings;
use FindBin;
use blib;
use JavaScript::Duktape::XS;
my $js = JavaScript::Duktape::XS->new();
$js->eval(
qq<
var croaker = function() { throw "hahaha" };
var got = [];
try {
croaker();
}
catch(e) {
got[1] = e;
}
got
>
);
… yields SIGABRT, with the following output:
duktape fatal error, aborting: uncaught: 'cannot read property 1 of undefined'