[Bps-public-commit] r16369 - in Path-Dispatcher/trunk: lib/Path/Dispatcher

sartak at bestpractical.com sartak at bestpractical.com
Sun Oct 19 07:13:29 EDT 2008


Author: sartak
Date: Sun Oct 19 07:13:19 2008
New Revision: 16369

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm

Log:
 r74142 at onn:  sartak | 2008-10-19 07:11:51 -0400
 Blocks are no longer required, so don't pass block => undef and trip the type constraint


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm	Sun Oct 19 07:13:19 2008
@@ -91,25 +91,25 @@
     ARRAY => sub {
         Path::Dispatcher::Rule::Tokens->new(
             tokens => $_[0],
-            block  => $_[1],
+            $_[1] ? (block => $_[1]) : (),
         ),
     },
     CODE => sub {
         Path::Dispatcher::Rule::CodeRef->new(
             matcher => $_[0],
-            block   => $_[1],
+            $_[1] ? (block => $_[1]) : (),
         ),
     },
     Regexp => sub {
         Path::Dispatcher::Rule::Regex->new(
             regex => $_[0],
-            block => $_[1],
+            $_[1] ? (block => $_[1]) : (),
         ),
     },
     '' => sub {
         Path::Dispatcher::Rule::Tokens->new(
             tokens => [ $_[0] ],
-            block  => $_[1],
+            $_[1] ? (block => $_[1]) : (),
         ),
     },
 );



More information about the Bps-public-commit mailing list