[Bast-commits] r4328 - in trunk/Devel-REPL/lib/Devel/REPL/Plugin: . B

nothingmuch at dev.catalyst.perl.org nothingmuch at dev.catalyst.perl.org
Mon May 5 19:41:36 BST 2008


Author: nothingmuch
Date: 2008-05-05 19:41:35 +0100 (Mon, 05 May 2008)
New Revision: 4328

Modified:
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/B/Concise.pm
   trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm
Log:
update B::Concise plugin for error handling

Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/B/Concise.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/B/Concise.pm	2008-05-05 18:37:22 UTC (rev 4327)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/B/Concise.pm	2008-05-05 18:41:35 UTC (rev 4328)
@@ -30,13 +30,17 @@
 
   my $sub = $self->compile($code, no_mangling => 1);
 
-  open my $fh, ">", \my $out;
-  {
-    local *STDOUT = $fh;
-    B::Concise::compile((split /\s+/, $opts), $sub)->();
+  if ( $self->is_error($sub) ) {
+    return $self->format($sub);
+  } else {
+    open my $fh, ">", \my $out;
+    {
+      local *STDOUT = $fh;
+      B::Concise::compile((split /\s+/, $opts), $sub)->();
+    }
+
+    return $out;
   }
-
-  return $out;
 }
 
 __PACKAGE__

Modified: trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm
===================================================================
--- trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm	2008-05-05 18:37:22 UTC (rev 4327)
+++ trunk/Devel-REPL/lib/Devel/REPL/Plugin/Peek.pm	2008-05-05 18:41:35 UTC (rev 4328)
@@ -12,10 +12,6 @@
 sub expr_command_peek {
   my ( $self, $eval, $code ) = @_;
 
-  if ( my $cont = $self->can("continue_reading_if_necessary") ) {
-    $code = $self->$cont($code);
-  }
-
   # can't override output properly
   # FIXME do some dup wizardry
   Dump( $self->eval($code) );




More information about the Bast-commits mailing list