Skip to content

Commit

Permalink
Tweak is_runtime to work on JVM also.
Browse files Browse the repository at this point in the history
Previous approach relied on Parrot namespaces, of all things.
  • Loading branch information
jnthn committed Jul 16, 2013
1 parent 4ad1b8e commit d57a8e3
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/core/Exception.pm
Expand Up @@ -183,16 +183,10 @@ do {
for $bt.keys {
try {
my Mu $sub := nqp::getattr(nqp::decont($bt[$_]<sub>), ForeignCode, '$!do');
return True if nqp::iseq_s(nqp::getcodename($sub), 'eval')
&& nqp::iseq_s(
nqp::join(';', $sub.get_namespace.get_name),
'nqp'
);
return False if nqp::iseq_s(nqp::getcodename($sub), 'compile')
&& nqp::iseq_s(
nqp::join(';', $sub.get_namespace.get_name),
'nqp'
);
my Mu $codeobj := nqp::ifnull(nqp::getcodeobj($sub), Mu);
my $is_nqp = $codeobj && $codeobj.HOW.name($codeobj) eq 'NQPRoutine';
return True if nqp::iseq_s(nqp::getcodename($sub), 'eval') && $is_nqp;
return False if nqp::iseq_s(nqp::getcodename($sub), 'compile') && $is_nqp;
}
}
return False;
Expand Down

0 comments on commit d57a8e3

Please sign in to comment.