[Jifty-commit] r6800 - Template-Declare/trunk/lib/Template/Declare

Jifty commits jifty-commit at lists.jifty.org
Mon Apr 20 01:24:28 EDT 2009


Author: jesse
Date: Mon Apr 20 01:24:28 2009
New Revision: 6800

Modified:
   Template-Declare/trunk/lib/Template/Declare/Tags.pm

Log:
Instead of setting the subroutine name and then calling caller to find out what it is, pass it in as an argument.

Modified: Template-Declare/trunk/lib/Template/Declare/Tags.pm
==============================================================================
--- Template-Declare/trunk/lib/Template/Declare/Tags.pm	(original)
+++ Template-Declare/trunk/lib/Template/Declare/Tags.pm	Mon Apr 20 01:24:28 2009
@@ -503,12 +503,12 @@
             my $sub   = sub {
                 local $self     = $_self;
                 local *__ANON__ = $tag;
-                _tag($tagset, @__);
+                _tag($tagset, $tag, @__);
             };
             bless $sub, 'Template::Declare::Tag';
             return $sub;
         } else {
-            _tag($tagset, @_);
+            _tag($tagset, $tag, @_);
         }
     };
     _install(
@@ -602,20 +602,10 @@
 
 sub _tag {
     my $tagset    = shift;
+    my $tag = shift;
     my $code      = shift;
     my $more_code = shift;
-    my ($package,   $filename, $line,       $subroutine, $hasargs,
-        $wantarray, $evaltext, $is_require, $hints,      $bitmask
-        )
-        = caller(1);
-
-    # This is the hash of attributes filled in by attr() calls in the code;
-
-    my $tag = $subroutine;
-    $tag =~ s/^.*\:\://;
-    # "html:foo"
-    $tag = $tagset->namespace . ":$tag"
-        if defined $tagset->namespace;
+    $tag = $tagset->namespace . ":$tag" if defined $tagset->namespace;
 
     Template::Declare->buffer->append(
               "\n" 


More information about the Jifty-commit mailing list