Skip to content

Instantly share code, notes, and snippets.

@moritz
Created August 7, 2012 09:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moritz/3283800 to your computer and use it in GitHub Desktop.
Save moritz/3283800 to your computer and use it in GitHub Desktop.
Circularity saw at Rakudo level
diff --git a/src/Perl6/ModuleLoader.pm b/src/Perl6/ModuleLoader.pm
index 26d7fe7..0a0c005 100644
--- a/src/Perl6/ModuleLoader.pm
+++ b/src/Perl6/ModuleLoader.pm
@@ -140,9 +140,12 @@ class Perl6::ModuleLoader {
my %*COMPILING := {};
my $*CTXSAVE := self;
my $*MAIN_CTX;
- pir::load_bytecode(%chosen<load>);
%modules_loaded{%chosen<key>} := $module_ctx := $*MAIN_CTX;
+ pir::load_bytecode(%chosen<load>);
DEBUG("done loading ", %chosen<load>) if $DEBUG;
+ CATCH {
+ nqp::deletekey(%modules_loaded, %chosen<key>);
+ }
}
else {
# Read source file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment