Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Make init with external $p5 less fragile.
Thanks to moritz++ for the suggestion.
  • Loading branch information
niner committed Feb 14, 2015
1 parent fbff133 commit c93c77c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Inline/Perl5.pm6
Expand Up @@ -620,9 +620,9 @@ class Perl5Callable {
}

my $default_perl5;
method BUILD(:$p5) {
$!p5 = $p5 === Any ?? p5_init_perl() !! $p5;
$!external_p5 = $p5 !=== Any;
method BUILD(*%args) {
$!external_p5 = %args<p5>:exists;
$!p5 = $!external_p5 ?? %args<p5> !! p5_init_perl();

&!call_method = sub (Int $index, Str $name, OpaquePointer $args, OpaquePointer $err) returns OpaquePointer {
my $p6obj = $objects.get($index);
Expand Down

0 comments on commit c93c77c

Please sign in to comment.