1234567891011121314 #!/usr/bin/env perluse strict;use warnings;use JavaScript::Writer;use Test::More;plan tests => 1;{ my $js = JavaScript::Writer->new; $js->object(1)->do(sub { $_[0]->alert(42) }); is "$js", "if(1){alert(42);}"}
#!/usr/bin/env perl
use
strict;
warnings;
JavaScript::Writer;
Test::More;
plan
tests
=> 1;
{
my
$js
= JavaScript::Writer->new;
->object(1)->
do
(
sub
$_
[0]->alert(42) });
is
"$js"
,
"if(1){alert(42);}"
}