Permalink
Browse files

Use nqp:: ops instead of parrot filehandle methods to read modules

  • Loading branch information...
sorear committed Jun 18, 2013
1 parent 676c35f commit 8839c5bd59dd7968b90b4c2100a0302c975cde86
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/Perl6/ModuleLoader.nqp
@@ -109,10 +109,18 @@ class Perl6::ModuleLoader does Perl6::ModuleLoaderVMConfig {
# Read source file.
DEBUG("loading ", %chosen<pm>) if $DEBUG;
+#?if parrot
my $fh := nqp::open(%chosen<pm>, 'r');
$fh.encoding('utf8');
my $source := $fh.readall();
$fh.close();
+#?endif
+#?if jvm
+ my $fh := nqp::open(%chosen<pm>, 'r');
+ nqp::setencoding($fh, 'utf8');
+ my $source := nqp::readallfh($fh);
+ nqp::closefh($fh);
+#?endif
# Get the compiler and compile the code, then run it
# (which runs the mainline and captures UNIT).

0 comments on commit 8839c5b

Please sign in to comment.