Skip to content
Permalink
Browse files

[js] Hooking in handling of unhandled exceptions

Might happen when running precompiled code not inside the compiler
  • Loading branch information...
pmurias committed Nov 12, 2018
1 parent 38bc682 commit 1865db0d9c9fa51c6bad4cef1a881d3756d2ddbd
Showing with 9 additions and 0 deletions.
  1. +9 −0 src/vm/js/load-compiler.nqp
@@ -37,3 +37,12 @@ nqp::bindhllsym('perl6', '@END_PHASERS', []);

# In an embedding environment, let @*ARGS be empty instead of crashing
nqp::bindhllsym('perl6', '$!ARGITER', 0);

nqp::sethllconfig('perl6', nqp::hash(
'uncaught_control', -> $exception {
nqp::getcomp('perl6').handle-control($exception);
},
'uncaught_exception', -> $exception {
nqp::getcomp('perl6').handle-exception($exception);
}
));

0 comments on commit 1865db0

Please sign in to comment.
You can’t perform that action at this time.