Browse files

enable $*CWD & cwd() on rakudo.jvm

  • Loading branch information...
1 parent 718f45a commit 567941498b550353fd088c00f03e0ab2ba4a51fc @coke coke committed Jun 30, 2013
Showing with 18 additions and 8 deletions.
  1. +4 −4 src/core/IO.pm
  2. +14 −4 src/core/terms.pm
View
8 src/core/IO.pm
@@ -566,16 +566,16 @@ multi sub spurt(Cool $filename,
proto sub cwd(|) { * }
multi sub cwd() {
-#?if parrot
return nqp::p6box_s(
+#?if parrot
pir::trans_encoding__Ssi(
nqp::cwd(),
- pir::find_encoding__Is('utf8')));
+ pir::find_encoding__Is('utf8'))
#?endif
#?if !parrot
- die "cwd is NYI on JVM backend";
+ nqp::cwd(),
#?endif
-
+ );
CATCH {
default {
X::IO::Cwd.new(
View
18 src/core/terms.pm
@@ -116,12 +116,22 @@ sub term:<time>() { nqp::p6box_i(nqp::time_i()) }
nqp::bindkey(nqp::who(PROCESS), '$OSVER', $OSVER);
#?endif
-#?if !jvm
- my $CWD = nqp::p6box_s(pir::trans_encoding__Ssi(
- pir::new__PS('OS').cwd,
- pir::find_encoding__Is('utf8'))).path;
+ ## duplicate src/core/IO.pm::cwd
+ my $CWD = nqp::p6box_s(
+#?if parrot
+ pir::trans_encoding__Ssi(
+ nqp::cwd(),
+ pir::find_encoding__Is('utf8'))
+#?endif
+#?if !parrot
+ nqp::cwd(),
+#?endif
+ );
+
nqp::bindkey(nqp::who(PROCESS), '$CWD', $CWD);
+#?if !jvm
+
my @INC;
@INC.push(%ENV<RAKUDOLIB>.split($VM<config><osname> eq 'MSWin32' ?? ';' !! ':')) if %ENV<RAKUDOLIB>;
@INC.push(%ENV<PERL6LIB>.split($VM<config><osname> eq 'MSWin32' ?? ';' !! ':')) if %ENV<PERL6LIB>;

0 comments on commit 5679414

Please sign in to comment.