Skip to content

Commit

Permalink
fix loading of NQP modules
Browse files Browse the repository at this point in the history
NQP's module loader does not know about the :$line named parameter.
Also, when we run deserialization tasks we have no GLOBALish to pass,
so don't pass any.
  • Loading branch information
FROGGS committed Jun 9, 2014
1 parent 186f0e4 commit 5fad7c6
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/Perl6/ModuleLoader.nqp
Expand Up @@ -66,11 +66,16 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
if nqp::existskey(%language_module_loaders, %opts<from>) {
# We expect that custom module loaders will accept a Stash, only
# NQP expects a hash and therefor needs special handling.
if +@GLOBALish && %opts<from> eq 'NQP' {
my $target := nqp::knowhow().new_type(:name('GLOBALish'));
nqp::setwho($target, @GLOBALish[0].WHO.FLATTENABLE_HASH());
return %language_module_loaders<NQP>.load_module($module_name,
$target);
if %opts<from> eq 'NQP' {
if +@GLOBALish {
my $target := nqp::knowhow().new_type(:name('GLOBALish'));
nqp::setwho($target, @GLOBALish[0].WHO.FLATTENABLE_HASH());
return %language_module_loaders<NQP>.load_module($module_name,
$target);
}
else {
return %language_module_loaders<NQP>.load_module($module_name);
}
}
return %language_module_loaders{%opts<from>}.load_module($module_name,
%opts, |@GLOBALish, :$line, :$file);
Expand Down

0 comments on commit 5fad7c6

Please sign in to comment.