Skip to content

Commit

Permalink
Some correction to make perlcritic tests happy.
Browse files Browse the repository at this point in the history
git-svn-id: http://code.handlino.com/svn/perl5/JavaScript-Writer@206 b19cb30a-9f2e-4084-8847-5e1a13269302
  • Loading branch information
gugod committed Feb 9, 2008
1 parent aca5192 commit 89e468f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
3 changes: 2 additions & 1 deletion MANIFEST
Expand Up @@ -17,7 +17,7 @@ lib/JavaScript/Writer.pm
lib/JavaScript/Writer/BasicHelpers.pm
lib/JavaScript/Writer/Block.pm
lib/JavaScript/Writer/Function.pm
lib/JavaScript/Writer/JQueryHelper.pm
lib/JavaScript/Writer/jQueryHelper.pm
lib/JavaScript/Writer/Var.pm
lib6/JavaScript/Writer.pm
Makefile.PL
Expand All @@ -39,6 +39,7 @@ t/10.helper.t
t/100.jquery.t
t/11.closure.t
t/12.var.t
t/13.obj_as_string.t
t/200.new_wave.t
t/50.function.t
t/51.control.t
Expand Down
11 changes: 5 additions & 6 deletions lib/JavaScript/Writer.pm
Expand Up @@ -168,15 +168,15 @@ sub var {
$s = "var $var;";
}

eval '
eval {
JavaScript::Writer::Var->new(
$value,
{
name => $var,
jsw => $self
}
);
';
};

}

Expand Down Expand Up @@ -491,7 +491,7 @@ stringify to this string:
function(){alert("Nihao")}
=head2 closure(&block)
=item closure(&block)
Generate a closure with body &block. This means to generate a
construct like this:
Expand All @@ -502,8 +502,7 @@ construct like this:
It's very useful for doing functional programming in javascript.
=head2 closure(arguments => { name => value }, body => sub {... }, ...)
=item closure(arguments => { name => value }, body => sub {... }, ...)
Another form of the closure function. For example:
Expand Down Expand Up @@ -545,7 +544,7 @@ This generates
jQuery(this).html(msg);
}).call(el, "Hello, World");
=head2 delay($n, &block)
=item delay($n, &block)
Generate a piece of code that delays the execution of &block for $n
seconds.
Expand Down
14 changes: 10 additions & 4 deletions lib/JavaScript/Writer/jQueryHelper.pm
Expand Up @@ -43,11 +43,17 @@ JavaScript::Writer::jQueryHelper - A "jQuery" helper method for writing jQuery c
# This is Perl code
jQuery("#area')->load("/data/foo.html");
=head1 DESCRIPTION
=head1 METHOD
This helper package provide only one method named 'jQuery' that acts
pretty much like jQuery in javascript. It constructs a
C<JavaScript::Writer> object like the way C<js> does.
=over
=item jQuery(...)
The only method exported by this helper module, acts pretty much like
jQuery in javascript. It constructs a C<JavaScript::Writer> object
like the way C<js> does.
=back
=head1 AUTHOR and LICENSE
Expand Down

0 comments on commit 89e468f

Please sign in to comment.