File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -24,5 +24,6 @@ WriteMakefile(
2424 },
2525 TEST_REQUIRES => {
2626 ' Test::Fatal' => ' 0.014' ,
27+ ' Try::Tiny' => ' 0.24' ,
2728 }
2829);
Original file line number Diff line number Diff line change @@ -5,6 +5,31 @@ use JavaScript::Duktape;
55use Test::More;
66use Test::Fatal;
77
8+ use Try::Tiny;
9+
10+ subtest ' try-tiny interaction' => sub {
11+ sub eval_js {
12+ my $code = shift ;
13+
14+ my $js = JavaScript::Duktape-> new;
15+
16+ try {
17+ $js -> eval ( $code );
18+ } catch {
19+ my $err = $_ ;
20+ warn " CAUGHT ERR: $err " ;
21+ die " JS ERR: $err " ;
22+ };
23+ }
24+
25+ eval {
26+ eval_js(q{
27+ throw new Error('oh boy!');
28+ } );
29+ };
30+ isnt $@ , ' ' , ' error message comes through' ;
31+ };
32+
833subtest ' simple nested thrown exception' => sub{
934 my $js = JavaScript::Duktape-> new();
1035 $js -> set( each => sub{
You can’t perform that action at this time.
0 commit comments