diff -Nru libjavascript-packer-perl-1.006003/Changes libjavascript-packer-perl-2.00/Changes --- libjavascript-packer-perl-1.006003/Changes 2012-03-02 13:31:49.000000000 +0000 +++ libjavascript-packer-perl-2.00/Changes 2015-05-27 12:30:06.000000000 +0000 @@ -1,5 +1,14 @@ Revision history for JavaScript-Packer +2.00 2015-05-27 + - New maintainer: LEEJO + - Merge PR from dod38fr (nevesenin/javascript-packer-perl:GH #8, nevesenin/javascript-packer-perl:GH #9) + - Fix "Redundant argument in sprintf" against perl 5.22 + - Repoint issue tracker/repo at leejo's fork + - Add .travis.yml for CI goodness + - Add Changes test + - Add MYMETA.json to .gitignore + 1.006003 2012-03-02 - This release fixes issue #1. - Added additional concat tests. diff -Nru libjavascript-packer-perl-1.006003/debian/changelog libjavascript-packer-perl-2.00/debian/changelog --- libjavascript-packer-perl-1.006003/debian/changelog 2014-10-09 11:58:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/debian/changelog 2015-07-05 16:09:10.000000000 +0000 @@ -1,3 +1,17 @@ +libjavascript-packer-perl (2.00-1) unstable; urgency=medium + + * Imported Upstream version 2.00 + * removed patch fix-random-var-name-issue (applied upstream) + * watch: removed version mangle, no longer necessary... + * compat: bumped to 9 + * control: + * added dod to uploaders + * added Testsuite parameter + * Build-Depends: set debhelper >= 9 + * copyright: added new maintainer (leejo at cpan.org) + + -- Dominique Dumont Sun, 05 Jul 2015 18:02:30 +0200 + libjavascript-packer-perl (1.006003-2) unstable; urgency=low * Team upload. diff -Nru libjavascript-packer-perl-1.006003/debian/compat libjavascript-packer-perl-2.00/debian/compat --- libjavascript-packer-perl-1.006003/debian/compat 2014-10-09 11:58:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/debian/compat 2015-07-05 16:09:10.000000000 +0000 @@ -1 +1 @@ -8 +9 diff -Nru libjavascript-packer-perl-1.006003/debian/control libjavascript-packer-perl-2.00/debian/control --- libjavascript-packer-perl-1.006003/debian/control 2014-10-09 11:58:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/debian/control 2015-07-05 16:09:10.000000000 +0000 @@ -4,10 +4,12 @@ Ernesto Hernández-Novich (USB) , Jonathan Yu , Jotam Jr. Trejo , - Angel Abad + Angel Abad , + Dominique Dumont Section: perl +Testsuite: autopkgtest-pkg-perl Priority: optional -Build-Depends: debhelper (>= 8) +Build-Depends: debhelper (>= 9) Build-Depends-Indep: libregexp-reggrp-perl, libtest-pod-perl, perl diff -Nru libjavascript-packer-perl-1.006003/debian/copyright libjavascript-packer-perl-2.00/debian/copyright --- libjavascript-packer-perl-1.006003/debian/copyright 2014-10-09 11:58:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/debian/copyright 2015-07-05 16:09:10.000000000 +0000 @@ -1,10 +1,11 @@ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: JavaScript-Packer -Upstream-Contact: Merten Falk +Upstream-Contact: Lee Johnson Source: https://metacpan.org/release/JavaScript-Packer Files: * Copyright: 2008-2011, Merten Falk + 2015, Lee Johnson License: Artistic or GPL-1+ Files: inc/Module/* diff -Nru libjavascript-packer-perl-1.006003/debian/patches/fix-random-var-name-issue libjavascript-packer-perl-2.00/debian/patches/fix-random-var-name-issue --- libjavascript-packer-perl-1.006003/debian/patches/fix-random-var-name-issue 2014-10-09 11:58:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/debian/patches/fix-random-var-name-issue 1970-01-01 00:00:00.000000000 +0000 @@ -1,112 +0,0 @@ -Description: Fix random var name issue - Test failures were due to randomisation of keys %foo. - . - A sort was added to all calls to keys. The tests were - modified to suit the now ordered keys results. -Bug: https://github.com/nevesenin/javascript-packer-perl/issues/8 -Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=711629 -Author: dod ---- a/lib/JavaScript/Packer.pm -+++ b/lib/JavaScript/Packer.pm -@@ -413,7 +413,7 @@ - my %shrunk_vars = map { $_ => 1 } ( ${$javascript} =~ /$SHRINK_VARS->{SHRUNK}/g ); - - my $cnt = 0; -- foreach my $shrunk_var ( keys( %shrunk_vars ) ) { -+ foreach my $shrunk_var ( sort keys( %shrunk_vars ) ) { - my $short_id; - do { - $short_id = $self->_encode52( $cnt++ ); -@@ -438,7 +438,7 @@ - $words->{$_}->{count}++; - } - -- WORD: foreach my $word ( sort { $words->{$b}->{count} <=> $words->{$a}->{count} } keys( %{$words} ) ) { -+ WORD: foreach my $word ( sort { $words->{$b}->{count} <=> $words->{$a}->{count} } sort keys( %{$words} ) ) { - - if ( exists( $words->{$word}->{encoded} ) and $words->{$word}->{encoded} eq $word ) { - next WORD; -@@ -473,7 +473,7 @@ - - my ( @pk, @pattern ) = ( (), () ); - -- foreach ( sort { $words->{$a}->{index} <=> $words->{$b}->{index} } keys( %{$words} ) ) { -+ foreach ( sort { $words->{$a}->{index} <=> $words->{$b}->{index} } sort keys( %{$words} ) ) { - $packed_length -= ( $words->{$_}->{count} * $words->{$_}->{minus} ); - - if ( $words->{$_}->{encoded} ne $_ ) { -@@ -645,7 +645,7 @@ - if ( $do_shrink ) { - - my $cnt = 0; -- foreach my $block_var ( keys( %block_vars ) ) { -+ foreach my $block_var ( sort keys( %block_vars ) ) { - if ( length( $block_var ) ) { - while ( $block =~ /$SHRINK_VARS->{PREFIX}\Q$cnt\E\b/ ) { - $cnt++; ---- a/t/scripts/s2-expected.js -+++ b/t/scripts/s2-expected.js -@@ -1,2 +1,2 @@ --function(b){var a='blah blubb';var d=3;alert(a);var f=1;//@a --var e=b;/*@abcd var f=1;@*/abcd var c=$H()};/*@abcd var x=1;@*/ -\ No newline at end of file -+function(c){var a='blah blubb';var e=3;alert(a);var d=1;//@a -+var b=c;/*@abcd var d=1;@*/abcd var f=$H()};/*@abcd var x=1;@*/ -\ No newline at end of file ---- a/t/scripts/s3-expected.js -+++ b/t/scripts/s3-expected.js -@@ -1 +1 @@ --eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[024-9]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2(b){0 a=\'7 9\';0 d=3;8(a);0 6=1;//@a\n0 e=b;/*@4 0 6=1;@*/4 0 c=$5()};',[],10,'var||function||abcd|H|f|blah|alert|blubb'.split('|'),0,{})) -\ No newline at end of file -+eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[024-9]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5(c){0 a=\'2 9\';0 e=3;8(a);0 d=1;//@a\n0 b=c;/*@4 0 d=1;@*/4 0 6=$7()};',[],10,'var||blah||abcd|function|f|H|alert|blubb'.split('|'),0,{})) -\ No newline at end of file ---- a/t/scripts/s4-expected.js -+++ b/t/scripts/s4-expected.js -@@ -1,2 +1,2 @@ --function(b){var a='blah blubb';var d=3;alert(a);var f=1;//@a --var e=b;/*@abcd var f=1;@*/abcd var c=$H()};/*@abcd var x=1;@*/ -\ No newline at end of file -+function(c){var a='blah blubb';var e=3;alert(a);var d=1;//@a -+var b=c;/*@abcd var d=1;@*/abcd var f=$H()};/*@abcd var x=1;@*/ -\ No newline at end of file ---- a/t/scripts/s5-expected.js -+++ b/t/scripts/s5-expected.js -@@ -1 +1 @@ --eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([2-9h-zB-Z]|1[0-9a-zA-Z])'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 I=7 3(){5 c=7 Y();5 d=3(g){8(!g.2(\'F\'))n;7 B.u(\'/9\'+g.2(\'F\')+\'x.w?\'+6.h(6.l()*m)+\'=\'+6.h(6.l()*m),{v:\'2\',y:3(a){5 f=7 K(\'R\').o(a.t.1k());f.1j(\'1c\').s(3(b){5 e=7 1b();e.N=b.10(\'N\');c[c.J]=e})}});8(g.2(\'L\')){g.2(\'L\').s(3(e){d(e)})}}n{Q:3(){5 b=C.U();b.s(3(e){d(e)})}}}5 9=7 3(){n{r:3(){5 g=$A(9.r.14);5 a=g.1d();8(!a){n}5 f=7 K(\'R\');f.13({\'19\':\'M\',\'1o\':\'M\'});8( $(\'i\').18()){7 q.1a(\'i\',{11:3(){7 B.u(\'/9\'+a+\'x.w?\'+6.h(6.l()*m)+\'=\'+6.h(6.l()*m),{v:\'2\',y:3(e){5 b=f.o(e.t); $(\'i\').o(b);7 q.G(\'i\',{H:0.E})}})},15:0.E})}O{7 B.u(\'/9\'+a+\'x.w?\'+6.h(6.l()*m)+\'=\'+6.h(6.l()*m),{v:\'2\',y:3(e){ $(\'i\').o(f.o(e.t));7 q.G(\'i\',{H:0.12})}})}}}}5 j=0;T.4.17({D:3(e){n 1i.D(e)},X:3(e){n e.16()}});3 p(b,e){b=b?b:\'/\';8(!j&&b){j=1;9.r(b);C.r(b);z()}}3 1h(b,e){8(!j){4.S(b,e)}p(b,e)}3 z(){5 e=$A(q.1f);8(e.J>0){Z("z();",1n)}O{j=0}}T.1m=3(){4.1e();4.1l(p);C.V();k=4.1g();k=k?k:\'/\';8(4.W()){8(!j){4.S(k,P)}p(k,P)}I.Q()}',[],87,'||get|function|dhtmlHistory|var|Math|new|if|content||||||||round|div_content|wait|initialLocation|random|99999|return|update|handle_location|Effect|process|each|responseText|Request|method|htm|index|onComplete|reset_wait||Ajax|menu|toJSON|01|loc|Appear|from|image|length|Element|subs|0px|src|else|null|preload|div|add|window|get_menu_hash|init|isFirstLoad|fromJSON|Array|setTimeout|readAttribute|afterFinish|00|setStyle|arguments|to|evalJSON|create|visible|padding|Fade|Image|img|shift|initialize|Queue|getCurrentLocation|handle_click|Object|select|stripScripts|addListener|onload|1000|margin'.split('|'),0,{})) -\ No newline at end of file -+eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([2-9h-zB-Z]|1[0-9a-zA-Z])'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 L=7 3(){5 g=7 W();5 f=3(e){9(!e.4(\'N\'))l;7 s.t(\'/h\'+e.4(\'N\')+\'w.v?\'+6.m(6.k()*8)+\'=\'+6.m(6.k()*8),{y:\'4\',z:3(d){5 c=7 G(\'I\').o(d.C.1m());c.1i(\'1a\').u(3(b){5 a=7 Y();a.Q=b.1h(\'Q\');g[g.M]=a})}});9(e.4(\'R\')){e.4(\'R\').u(3(a){f(a)})}}l{P:3(){5 b=x.18();b.u(3(a){f(a)})}}}5 h=7 3(){l{r:3(){5 c=$A(h.r.13);5 e=c.1l();9(!e){l}5 d=7 G(\'I\');d.1j({\'1g\':\'E\',\'1e\':\'E\'});9( $(\'i\').1o()){7 p.X(\'i\',{12:3(){7 s.t(\'/h\'+e+\'w.v?\'+6.m(6.k()*8)+\'=\'+6.m(6.k()*8),{y:\'4\',z:3(a){5 b=d.o(a.C); $(\'i\').o(b);7 p.F(\'i\',{K:0.D})}})},1n:0.D})}J{7 s.t(\'/h\'+e+\'w.v?\'+6.m(6.k()*8)+\'=\'+6.m(6.k()*8),{y:\'4\',z:3(a){ $(\'i\').o(d.o(a.C));7 p.F(\'i\',{K:0.U})}})}}}}5 n=0;T.2.14({S:3(a){l Z.S(a)},16:3(a){l a.15()}});3 q(b,a){b=b?b:\'/\';9(!n&&b){n=1;h.r(b);x.r(b);B()}}3 19(b,a){9(!n){2.H(b,a)}q(b,a)}3 B(){5 a=$A(p.10);9(a.M>0){1k("B();",V)}J{n=0}}T.1f=3(){2.1c();2.11(q);x.1b();j=2.17();j=j?j:\'/\';9(2.1d()){9(!n){2.H(j,O)}q(j,O)}L.P()}',[],87,'||dhtmlHistory|function|get|var|Math|new|99999|if||||||||content|div_content|initialLocation|random|return|round|wait|update|Effect|handle_location|process|Ajax|Request|each|htm|index|menu|method|onComplete||reset_wait|responseText|01|0px|Appear|Element|add|div|else|from|image|length|loc|null|preload|src|subs|toJSON|window|00|1000|Array|Fade|Image|Object|Queue|addListener|afterFinish|arguments|create|evalJSON|fromJSON|getCurrentLocation|get_menu_hash|handle_click|img|init|initialize|isFirstLoad|margin|onload|padding|readAttribute|select|setStyle|setTimeout|shift|stripScripts|to|visible'.split('|'),0,{})) -\ No newline at end of file ---- a/t/scripts/s10-expected.js -+++ b/t/scripts/s10-expected.js -@@ -1 +1 @@ --function initScript(){var a=parseXML("config.xml").getElementsByTagName("config");var b=parseXML('konfig.xml').getElementsByTagName('konfig');var c='conf.xml';var e='conf';var d=parseXML(c).getElementsByTagName(e)} -\ No newline at end of file -+function initScript(){var c=parseXML("config.xml").getElementsByTagName("config");var e=parseXML('konfig.xml').getElementsByTagName('konfig');var b='conf.xml';var a='conf';var d=parseXML(b).getElementsByTagName(a)} -\ No newline at end of file ---- a/t/scripts/s8-expected.js -+++ b/t/scripts/s8-expected.js -@@ -1 +1 @@ --function(b){var d=x;var c=y;var a=(function(){return[].concat(arguments)[0][0]!==1})(1,do_somthing(do_something_else(d,c),d));if(a)arrayProto.concat=concat} -\ No newline at end of file -+function(d){var b=x;var c=y;var a=(function(){return[].concat(arguments)[0][0]!==1})(1,do_somthing(do_something_else(b,c),b));if(a)arrayProto.concat=concat} -\ No newline at end of file ---- a/t/02-io.t -+++ b/t/02-io.t -@@ -25,7 +25,7 @@ - fileTest( 's7', 'clean', 'compression level "clean" function as argument' ); - fileTest( 's8', 'shrink', 'compression level "shrink" function as argument' ); - fileTest( 's9', 'shrink', 'compression level "shrink" with _no_shrink_ argument' ); -- fileTest( 's10', 'shrink', 'compression level "shrink" with qouted args' ); -+ fileTest( 's10', 'shrink', 'compression level "shrink" with quoted args' ); - - my $packer = JavaScript::Packer->init(); - -@@ -52,7 +52,7 @@ - is( - $var, - '/* BSD */' -- . "\neval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[01]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('0 1=2;',[],2,'var|x'.split('|'),0,{}))", -+ . "\neval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[01]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('1 0=2;',[],2,'x|var'.split('|'),0,{}))", - 'copyright option compression level "obfuscate"' - ); - diff -Nru libjavascript-packer-perl-1.006003/debian/patches/series libjavascript-packer-perl-2.00/debian/patches/series --- libjavascript-packer-perl-1.006003/debian/patches/series 2014-10-09 11:58:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/debian/patches/series 2015-07-05 16:09:10.000000000 +0000 @@ -1 +0,0 @@ -fix-random-var-name-issue diff -Nru libjavascript-packer-perl-1.006003/debian/watch libjavascript-packer-perl-2.00/debian/watch --- libjavascript-packer-perl-1.006003/debian/watch 2014-10-09 11:58:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/debian/watch 2015-07-05 16:09:10.000000000 +0000 @@ -1,3 +1,2 @@ version=3 -opts="uversionmangle=s/\.\d\d\d\d$/$&00/;s/\.\d\d\d$/$&000/;s/\.\d\d$/$&0000/" \ https://metacpan.org/release/JavaScript-Packer .*/JavaScript-Packer-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ diff -Nru libjavascript-packer-perl-1.006003/.gitignore libjavascript-packer-perl-2.00/.gitignore --- libjavascript-packer-perl-1.006003/.gitignore 2011-01-27 06:37:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/.gitignore 2015-05-27 12:29:55.000000000 +0000 @@ -5,6 +5,7 @@ /MANIFEST.bak /META.yml /MYMETA.yml +/MYMETA.json /Build /_build* /pm_to_blib* diff -Nru libjavascript-packer-perl-1.006003/inc/Module/AutoInstall.pm libjavascript-packer-perl-2.00/inc/Module/AutoInstall.pm --- libjavascript-packer-perl-1.006003/inc/Module/AutoInstall.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/AutoInstall.pm 2015-05-27 12:38:11.000000000 +0000 @@ -3,11 +3,12 @@ use strict; use Cwd (); +use File::Spec (); use ExtUtils::MakeMaker (); use vars qw{$VERSION}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; } # special map on pre-defined feature sets @@ -114,7 +115,7 @@ print "*** $class version " . $class->VERSION . "\n"; print "*** Checking for Perl dependencies...\n"; - my $cwd = Cwd::cwd(); + my $cwd = Cwd::getcwd(); $Config = []; @@ -165,7 +166,7 @@ $modules = [ %{$modules} ] if UNIVERSAL::isa( $modules, 'HASH' ); unshift @$modules, -default => &{ shift(@$modules) } - if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward combatability + if ( ref( $modules->[0] ) eq 'CODE' ); # XXX: bugward compatibility while ( my ( $mod, $arg ) = splice( @$modules, 0, 2 ) ) { if ( $mod =~ m/^-(\w+)$/ ) { @@ -187,7 +188,7 @@ } # XXX: check for conflicts and uninstalls(!) them. - my $cur = _load($mod); + my $cur = _version_of($mod); if (_version_cmp ($cur, $arg) >= 0) { print "loaded. ($cur" . ( $arg ? " >= $arg" : '' ) . ")\n"; @@ -344,22 +345,26 @@ my $i; # used below to strip leading '-' from config keys my @config = ( map { s/^-// if ++$i; $_ } @{ +shift } ); - my ( @modules, @installed ); - while ( my ( $pkg, $ver ) = splice( @_, 0, 2 ) ) { + my ( @modules, @installed, @modules_to_upgrade ); + while (my ($pkg, $ver) = splice(@_, 0, 2)) { - # grep out those already installed - if ( _version_cmp( _load($pkg), $ver ) >= 0 ) { - push @installed, $pkg; - } - else { - push @modules, $pkg, $ver; - } - } + # grep out those already installed + if (_version_cmp(_version_of($pkg), $ver) >= 0) { + push @installed, $pkg; + if ($UpgradeDeps) { + push @modules_to_upgrade, $pkg, $ver; + } + } + else { + push @modules, $pkg, $ver; + } + } - if ($UpgradeDeps) { - push @modules, @installed; - @installed = (); - } + if ($UpgradeDeps) { + push @modules, @modules_to_upgrade; + @installed = (); + @modules_to_upgrade = (); + } return @installed unless @modules; # nothing to do return @installed if _check_lock(); # defer to the CPAN shell @@ -392,7 +397,7 @@ # see if we have successfully installed them while ( my ( $pkg, $ver ) = splice( @modules, 0, 2 ) ) { - if ( _version_cmp( _load($pkg), $ver ) >= 0 ) { + if ( _version_cmp( _version_of($pkg), $ver ) >= 0 ) { push @installed, $pkg; } elsif ( $args{do_once} and open( FAILED, '>> .#autoinstall.failed' ) ) { @@ -532,7 +537,7 @@ while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) { ( $args{$opt} = $arg, next ) if $opt =~ /^(?:force|notest)$/; # pseudo-option - $CPAN::Config->{$opt} = $arg; + $CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg; } if ($args{notest} && (not CPAN::Shell->can('notest'))) { @@ -610,7 +615,7 @@ require Cwd; require File::Spec; - my $cwd = File::Spec->canonpath( Cwd::cwd() ); + my $cwd = File::Spec->canonpath( Cwd::getcwd() ); my $cpan = File::Spec->canonpath( $CPAN::Config->{cpan_home} ); return ( index( $cwd, $cpan ) > -1 ); @@ -621,7 +626,7 @@ my $ver = shift; return - if _version_cmp( _load($class), $ver ) >= 0; # no need to upgrade + if _version_cmp( _version_of($class), $ver ) >= 0; # no need to upgrade if ( _prompt( "==> A newer version of $class ($ver) is required. Install?", @@ -706,16 +711,30 @@ # load a module and return the version it reports sub _load { - my $mod = pop; # class/instance doesn't matter + my $mod = pop; # method/function doesn't matter my $file = $mod; - $file =~ s|::|/|g; $file .= '.pm'; - local $@; return eval { require $file; $mod->VERSION } || ( $@ ? undef: 0 ); } +# report version without loading a module +sub _version_of { + my $mod = pop; # method/function doesn't matter + my $file = $mod; + $file =~ s|::|/|g; + $file .= '.pm'; + foreach my $dir ( @INC ) { + next if ref $dir; + my $path = File::Spec->catfile($dir, $file); + next unless -e $path; + require ExtUtils::MM_Unix; + return ExtUtils::MM_Unix->parse_version($path); + } + return undef; +} + # Load CPAN.pm and it's configuration sub _load_cpan { return if $CPAN::VERSION and $CPAN::Config and not @_; @@ -912,4 +931,4 @@ __END__ -#line 1178 +#line 1197 diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/AutoInstall.pm libjavascript-packer-perl-2.00/inc/Module/Install/AutoInstall.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/AutoInstall.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/AutoInstall.pm 2015-05-27 12:38:11.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/Base.pm libjavascript-packer-perl-2.00/inc/Module/Install/Base.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/Base.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/Base.pm 2015-05-27 12:38:11.000000000 +0000 @@ -4,7 +4,7 @@ use strict 'vars'; use vars qw{$VERSION}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; } # Suspend handler for "redefined" warnings diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/Can.pm libjavascript-packer-perl-2.00/inc/Module/Install/Can.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/Can.pm 2012-03-02 13:44:42.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/Can.pm 2015-05-27 12:38:11.000000000 +0000 @@ -3,13 +3,12 @@ use strict; use Config (); -use File::Spec (); use ExtUtils::MakeMaker (); use Module::Install::Base (); use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -29,7 +28,7 @@ eval { require $mod; $pkg->VERSION($ver || 0); 1 }; } -# check if we can run some command +# Check if we can run some command sub can_run { my ($self, $cmd) = @_; @@ -38,14 +37,88 @@ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') { next if $dir eq ''; - my $abs = File::Spec->catfile($dir, $_[1]); + require File::Spec; + my $abs = File::Spec->catfile($dir, $cmd); return $abs if (-x $abs or $abs = MM->maybe_command($abs)); } return; } -# can we locate a (the) C compiler +# Can our C compiler environment build XS files +sub can_xs { + my $self = shift; + + # Ensure we have the CBuilder module + $self->configure_requires( 'ExtUtils::CBuilder' => 0.27 ); + + # Do we have the configure_requires checker? + local $@; + eval "require ExtUtils::CBuilder;"; + if ( $@ ) { + # They don't obey configure_requires, so it is + # someone old and delicate. Try to avoid hurting + # them by falling back to an older simpler test. + return $self->can_cc(); + } + + # Do we have a working C compiler + my $builder = ExtUtils::CBuilder->new( + quiet => 1, + ); + unless ( $builder->have_compiler ) { + # No working C compiler + return 0; + } + + # Write a C file representative of what XS becomes + require File::Temp; + my ( $FH, $tmpfile ) = File::Temp::tempfile( + "compilexs-XXXXX", + SUFFIX => '.c', + ); + binmode $FH; + print $FH <<'END_C'; +#include "EXTERN.h" +#include "perl.h" +#include "XSUB.h" + +int main(int argc, char **argv) { + return 0; +} + +int boot_sanexs() { + return 1; +} + +END_C + close $FH; + + # Can the C compiler access the same headers XS does + my @libs = (); + my $object = undef; + eval { + local $^W = 0; + $object = $builder->compile( + source => $tmpfile, + ); + @libs = $builder->link( + objects => $object, + module_name => 'sanexs', + ); + }; + my $result = $@ ? 0 : 1; + + # Clean up all the build files + foreach ( $tmpfile, $object, @libs ) { + next unless defined $_; + 1 while unlink; + } + + return $result; +} + +# Can we locate a (the) C compiler sub can_cc { my $self = shift; my @chunks = split(/ /, $Config::Config{cc}) or return; @@ -78,4 +151,4 @@ __END__ -#line 156 +#line 236 diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/Fetch.pm libjavascript-packer-perl-2.00/inc/Module/Install/Fetch.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/Fetch.pm 2012-03-02 13:44:42.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/Fetch.pm 2015-05-27 12:38:11.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/Include.pm libjavascript-packer-perl-2.00/inc/Module/Install/Include.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/Include.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/Include.pm 2015-05-27 12:38:11.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/Makefile.pm libjavascript-packer-perl-2.00/inc/Module/Install/Makefile.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/Makefile.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/Makefile.pm 2015-05-27 12:38:11.000000000 +0000 @@ -8,7 +8,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -133,7 +133,7 @@ return $args; } -# For mm args that take multiple space-seperated args, +# For mm args that take multiple space-separated args, # append an argument to the current list. sub makemaker_append { my $self = shift; @@ -215,13 +215,17 @@ require ExtUtils::MakeMaker; if ( $perl_version and $self->_cmp($perl_version, '5.006') >= 0 ) { - # MakeMaker can complain about module versions that include - # an underscore, even though its own version may contain one! - # Hence the funny regexp to get rid of it. See RT #35800 - # for details. - my ($v) = $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/; - $self->build_requires( 'ExtUtils::MakeMaker' => $v ); - $self->configure_requires( 'ExtUtils::MakeMaker' => $v ); + # This previous attempted to inherit the version of + # ExtUtils::MakeMaker in use by the module author, but this + # was found to be untenable as some authors build releases + # using future dev versions of EU:MM that nobody else has. + # Instead, #toolchain suggests we use 6.59 which is the most + # stable version on CPAN at time of writing and is, to quote + # ribasushi, "not terminally fucked, > and tested enough". + # TODO: We will now need to maintain this over time to push + # the version up as new versions are released. + $self->build_requires( 'ExtUtils::MakeMaker' => 6.59 ); + $self->configure_requires( 'ExtUtils::MakeMaker' => 6.59 ); } else { # Allow legacy-compatibility with 5.005 by depending on the # most recent EU:MM that supported 5.005. @@ -411,4 +415,4 @@ __END__ -#line 540 +#line 544 diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/Metadata.pm libjavascript-packer-perl-2.00/inc/Module/Install/Metadata.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/Metadata.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/Metadata.pm 2015-05-27 12:38:11.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } @@ -347,7 +347,7 @@ ^ \s* package \s* ([\w:]+) - \s* ; + [\s|;]* /ixms ) { my ($name, $module_name) = ($1, $1); @@ -705,7 +705,7 @@ my @yaml = Parse::CPAN::Meta::LoadFile('META.yml'); my $meta = $yaml[0]; - # Overwrite the non-configure dependency hashs + # Overwrite the non-configure dependency hashes delete $meta->{requires}; delete $meta->{build_requires}; delete $meta->{recommends}; diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/Win32.pm libjavascript-packer-perl-2.00/inc/Module/Install/Win32.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/Win32.pm 2012-03-02 13:44:42.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/Win32.pm 2015-05-27 12:38:11.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = 'Module::Install::Base'; $ISCORE = 1; } diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install/WriteAll.pm libjavascript-packer-perl-2.00/inc/Module/Install/WriteAll.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install/WriteAll.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install/WriteAll.pm 2015-05-27 12:38:11.000000000 +0000 @@ -6,7 +6,7 @@ use vars qw{$VERSION @ISA $ISCORE}; BEGIN { - $VERSION = '1.04'; + $VERSION = '1.16'; @ISA = qw{Module::Install::Base}; $ISCORE = 1; } diff -Nru libjavascript-packer-perl-1.006003/inc/Module/Install.pm libjavascript-packer-perl-2.00/inc/Module/Install.pm --- libjavascript-packer-perl-1.006003/inc/Module/Install.pm 2012-03-02 13:44:41.000000000 +0000 +++ libjavascript-packer-perl-2.00/inc/Module/Install.pm 2015-05-27 12:38:11.000000000 +0000 @@ -17,7 +17,7 @@ # 3. The ./inc/ version of Module::Install loads # } -use 5.005; +use 5.006; use strict 'vars'; use Cwd (); use File::Find (); @@ -31,7 +31,7 @@ # This is not enforced yet, but will be some time in the next few # releases once we can make sure it won't clash with custom # Module::Install extensions. - $VERSION = '1.04'; + $VERSION = '1.16'; # Storage for the pseudo-singleton $MAIN = undef; @@ -156,10 +156,10 @@ sub autoload { my $self = shift; my $who = $self->_caller; - my $cwd = Cwd::cwd(); + my $cwd = Cwd::getcwd(); my $sym = "${who}::AUTOLOAD"; $sym->{$cwd} = sub { - my $pwd = Cwd::cwd(); + my $pwd = Cwd::getcwd(); if ( my $code = $sym->{$pwd} ) { # Delegate back to parent dirs goto &$code unless $cwd eq $pwd; @@ -239,7 +239,7 @@ # ignore the prefix on extension modules built from top level. my $base_path = Cwd::abs_path($FindBin::Bin); - unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) { + unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) { delete $args{prefix}; } return $args{_self} if $args{_self}; @@ -338,7 +338,7 @@ if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) { my $content = Module::Install::_read($subpath . '.pm'); my $in_pod = 0; - foreach ( split //, $content ) { + foreach ( split /\n/, $content ) { $in_pod = 1 if /^=\w/; $in_pod = 0 if /^=cut/; next if ($in_pod || /^=cut/); # skip pod text @@ -378,6 +378,7 @@ sub _read { local *FH; open( FH, '<', $_[0] ) or die "open($_[0]): $!"; + binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; @@ -386,6 +387,7 @@ sub _read { local *FH; open( FH, "< $_[0]" ) or die "open($_[0]): $!"; + binmode FH; my $string = do { local $/; }; close FH or die "close($_[0]): $!"; return $string; @@ -416,6 +418,7 @@ sub _write { local *FH; open( FH, '>', $_[0] ) or die "open($_[0]): $!"; + binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } @@ -425,6 +428,7 @@ sub _write { local *FH; open( FH, "> $_[0]" ) or die "open($_[0]): $!"; + binmode FH; foreach ( 1 .. $#_ ) { print FH $_[$_] or die "print($_[0]): $!"; } @@ -434,7 +438,7 @@ # _version is for processing module versions (eg, 1.03_05) not # Perl versions (eg, 5.8.1). -sub _version ($) { +sub _version { my $s = shift || 0; my $d =()= $s =~ /(\.)/g; if ( $d >= 2 ) { @@ -450,12 +454,12 @@ return $l + 0; } -sub _cmp ($$) { +sub _cmp { _version($_[1]) <=> _version($_[2]); } # Cloned from Params::Util::_CLASS -sub _CLASS ($) { +sub _CLASS { ( defined $_[0] and @@ -467,4 +471,4 @@ 1; -# Copyright 2008 - 2011 Adam Kennedy. +# Copyright 2008 - 2012 Adam Kennedy. diff -Nru libjavascript-packer-perl-1.006003/lib/JavaScript/Packer.pm libjavascript-packer-perl-2.00/lib/JavaScript/Packer.pm --- libjavascript-packer-perl-1.006003/lib/JavaScript/Packer.pm 2012-03-02 13:04:40.000000000 +0000 +++ libjavascript-packer-perl-2.00/lib/JavaScript/Packer.pm 2015-05-27 12:38:07.000000000 +0000 @@ -8,7 +8,7 @@ # =========================================================================== # -our $VERSION = '1.006003'; +our $VERSION = "2.00"; our @BOOLEAN_ACCESSORS = ( 'no_compress_comment', 'remove_copyright' ); @@ -297,7 +297,7 @@ $self->reggrp_clean()->exec( \$submatches->[1] ); $self->reggrp_whitespace()->exec( \$submatches->[1] ); - return sprintf( "//%s%s\n%s", @{$submatches} ); + return sprintf( "//%s%s\n%s", @{$submatches}[0 .. 2] ); } return sprintf( "\n%s", $submatches->[2] ); }; @@ -413,7 +413,7 @@ my %shrunk_vars = map { $_ => 1 } ( ${$javascript} =~ /$SHRINK_VARS->{SHRUNK}/g ); my $cnt = 0; - foreach my $shrunk_var ( keys( %shrunk_vars ) ) { + foreach my $shrunk_var ( sort keys( %shrunk_vars ) ) { my $short_id; do { $short_id = $self->_encode52( $cnt++ ); @@ -438,7 +438,7 @@ $words->{$_}->{count}++; } - WORD: foreach my $word ( sort { $words->{$b}->{count} <=> $words->{$a}->{count} } keys( %{$words} ) ) { + WORD: foreach my $word ( sort { $words->{$b}->{count} <=> $words->{$a}->{count} } sort keys( %{$words} ) ) { if ( exists( $words->{$word}->{encoded} ) and $words->{$word}->{encoded} eq $word ) { next WORD; @@ -473,7 +473,7 @@ my ( @pk, @pattern ) = ( (), () ); - foreach ( sort { $words->{$a}->{index} <=> $words->{$b}->{index} } keys( %{$words} ) ) { + foreach ( sort { $words->{$a}->{index} <=> $words->{$b}->{index} } sort keys( %{$words} ) ) { $packed_length -= ( $words->{$_}->{count} * $words->{$_}->{minus} ); if ( $words->{$_}->{encoded} ne $_ ) { @@ -645,7 +645,7 @@ if ( $do_shrink ) { my $cnt = 0; - foreach my $block_var ( keys( %block_vars ) ) { + foreach my $block_var ( sort keys( %block_vars ) ) { if ( length( $block_var ) ) { while ( $block =~ /$SHRINK_VARS->{PREFIX}\Q$cnt\E\b/ ) { $cnt++; @@ -712,9 +712,13 @@ JavaScript::Packer - Perl version of Dean Edwards' Packer.js +=for html +Build Status +Coverage Status + =head1 VERSION -Version 1.006003 +Version 2.00 =head1 DESCRIPTION @@ -833,12 +837,13 @@ =head1 AUTHOR -Merten Falk, C<< >> +Merten Falk, C<< >>. Now maintained by Lee +Johnson (LEEJO) =head1 BUGS Please report any bugs or feature requests through the web interface at -L. +L. =head1 SUPPORT diff -Nru libjavascript-packer-perl-1.006003/Makefile.PL libjavascript-packer-perl-2.00/Makefile.PL --- libjavascript-packer-perl-1.006003/Makefile.PL 2012-02-18 16:06:59.000000000 +0000 +++ libjavascript-packer-perl-2.00/Makefile.PL 2015-05-27 12:17:57.000000000 +0000 @@ -7,8 +7,8 @@ test_requires 'Test::More' => 0; requires 'Regexp::RegGrp' => "1.001_001"; -repository 'http://github.com/nevesenin/javascript-packer-perl'; -bugtracker 'http://github.com/nevesenin/javascript-packer-perl/issues'; +repository 'http://github.com/leejo/javascript-packer-perl'; +bugtracker 'http://github.com/leejo/javascript-packer-perl/issues'; clean_files 't/scripts/s*-got.js'; diff -Nru libjavascript-packer-perl-1.006003/META.yml libjavascript-packer-perl-2.00/META.yml --- libjavascript-packer-perl-1.006003/META.yml 2012-03-02 13:44:42.000000000 +0000 +++ libjavascript-packer-perl-2.00/META.yml 2015-05-27 12:38:11.000000000 +0000 @@ -1,15 +1,15 @@ --- abstract: "Perl version of Dean Edwards' Packer.js" author: - - 'Merten Falk, C<< >>' + - 'Merten Falk, C<< >>. Now maintained by Lee' build_requires: - ExtUtils::MakeMaker: 6.56 + ExtUtils::MakeMaker: 6.59 Test::More: 0 configure_requires: - ExtUtils::MakeMaker: 6.56 + ExtUtils::MakeMaker: 6.59 distribution_type: module dynamic_config: 1 -generated_by: 'Module::Install version 1.04' +generated_by: 'Module::Install version 1.16' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -24,7 +24,7 @@ Regexp::RegGrp: 1.001_001 perl: 5.8.9 resources: - bugtracker: http://github.com/nevesenin/javascript-packer-perl/issues + bugtracker: http://github.com/leejo/javascript-packer-perl/issues license: http://dev.perl.org/licenses/ - repository: http://github.com/nevesenin/javascript-packer-perl -version: 1.006003 + repository: http://github.com/leejo/javascript-packer-perl +version: '2.00' diff -Nru libjavascript-packer-perl-1.006003/README libjavascript-packer-perl-2.00/README --- libjavascript-packer-perl-1.006003/README 2011-04-14 06:13:29.000000000 +0000 +++ libjavascript-packer-perl-2.00/README 2015-05-27 12:31:59.000000000 +0000 @@ -1,43 +1,125 @@ -JavaScript-Packer +NAME + JavaScript::Packer - Perl version of Dean Edwards' Packer.js -INSTALLATION +VERSION + Version 2.00 -To install this module, run the following commands: +DESCRIPTION + A JavaScript Compressor - perl Makefile.PL - make - make test - make install + This module is an adaptation of Dean Edwards' Packer.js. -SUPPORT AND DOCUMENTATION + Additional information: http://dean.edwards.name/packer/ -After installing, you can find documentation for this module with the -perldoc command. +SYNOPSIS + use JavaScript::Packer; - perldoc JavaScript::Packer + my $packer = JavaScript::Packer->init(); + + $packer->minify( $javascript, $opts ); + + To return a scalar without changing the input simply use (e.g. example + 2): + + my $ret = $packer->minify( $javascript, $opts ); + + For backward compatibility it is still possible to call 'minify' as a + function: + + JavaScript::Packer::minify( $javascript, $opts ); + + The first argument must be a scalarref of javascript-code. + + Second argument must be a hashref of options. Possible options are: + + compress + Defines compression level. Possible values are 'clean', 'shrink', + 'obfuscate' and 'best'. Default value is 'clean'. 'best' uses + 'shrink' or 'obfuscate' depending on which result is shorter. This + is recommended because especially when compressing short scripts the + result will exceed the input if compression level is 'obfuscate'. + + copyright + You can add a copyright notice at the top of the script. + + remove_copyright + If there is a copyright notice in a comment it will only be removed + if this option is set to a true value. Otherwise the first comment + that contains the word "copyright" will be added at the top of the + packed script. A copyright comment will be overwritten by a + copyright notice defined with the copyright option. + + no_compress_comment + If not set to a true value it is allowed to set a JavaScript comment + that prevents the input being packed or defines a compression level. + + /* JavaScript::Packer _no_compress_ */ + /* JavaScript::Packer shrink */ + +EXAMPLES + Example 1 + Common usage. -You can also look for information at: + #!/usr/bin/perl - github - http://github.com/nevesenin/javascript-packer-perl + use strict; + use warnings; - RT, CPAN's request tracker - http://rt.cpan.org/NoAuth/Bugs.html?Dist=JavaScript-Packer + use JavaScript::Packer; - AnnoCPAN, Annotated CPAN documentation - http://annocpan.org/dist/JavaScript-Packer + my $packer = JavaScript::Packer->init(); - CPAN Ratings - http://cpanratings.perl.org/d/JavaScript-Packer + open( UNCOMPRESSED, 'uncompressed.js' ); + open( COMPRESSED, '>compressed.js' ); - Search CPAN - http://search.cpan.org/dist/JavaScript-Packer/ + my $js = join( '', ); + $packer->minify( \$js, { compress => 'best' } ); -COPYRIGHT AND LICENCE + print COMPRESSED $js; + close(UNCOMPRESSED); + close(COMPRESSED); + + Example 2 + A scalar is requested by the context. The input will remain + unchanged. + + #!/usr/bin/perl + + use strict; + use warnings; + + use JavaScript::Packer; + + my $packer = JavaScript::Packer->init(); + + open( UNCOMPRESSED, 'uncompressed.js' ); + open( COMPRESSED, '>compressed.js' ); + + my $uncompressed = join( '', ); + + my $compressed = $packer->minify( \$uncompressed, { compress => 'best' } ); + + print COMPRESSED $compressed; + close(UNCOMPRESSED); + close(COMPRESSED); + +AUTHOR + Merten Falk, `'. Now maintained by Lee Johnson + (LEEJO) + +BUGS + Please report any bugs or feature requests through the web interface at + http://github.com/leejo/javascript-packer-perl/issues. + +SUPPORT + You can find documentation for this module with the perldoc command. + + perldoc JavaScript::Packer -Copyright (C) 2008 - 2011 Merten Falk +COPYRIGHT & LICENSE + Copyright 2008 - 2012 Merten Falk, all rights reserved. -This program is free software; you can redistribute it and/or modify it -under the same terms as Perl itself. + This program is free software; you can redistribute it and/or modify it + under the same terms as Perl itself. diff -Nru libjavascript-packer-perl-1.006003/t/02-io.t libjavascript-packer-perl-2.00/t/02-io.t --- libjavascript-packer-perl-1.006003/t/02-io.t 2012-03-02 13:09:34.000000000 +0000 +++ libjavascript-packer-perl-2.00/t/02-io.t 2015-05-27 12:15:09.000000000 +0000 @@ -25,7 +25,7 @@ fileTest( 's7', 'clean', 'compression level "clean" function as argument' ); fileTest( 's8', 'shrink', 'compression level "shrink" function as argument' ); fileTest( 's9', 'shrink', 'compression level "shrink" with _no_shrink_ argument' ); - fileTest( 's10', 'shrink', 'compression level "shrink" with qouted args' ); + fileTest( 's10', 'shrink', 'compression level "shrink" with quoted args' ); my $packer = JavaScript::Packer->init(); @@ -52,7 +52,7 @@ is( $var, '/* BSD */' - . "\neval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[01]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('0 1=2;',[],2,'var|x'.split('|'),0,{}))", + . "\neval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[01]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\\\b'+e(c)+'\\\\b','g'),k[c]);return p}('1 0=2;',[],2,'x|var'.split('|'),0,{}))", 'copyright option compression level "obfuscate"' ); diff -Nru libjavascript-packer-perl-1.006003/t/scripts/s10-expected.js libjavascript-packer-perl-2.00/t/scripts/s10-expected.js --- libjavascript-packer-perl-1.006003/t/scripts/s10-expected.js 2011-01-27 08:41:30.000000000 +0000 +++ libjavascript-packer-perl-2.00/t/scripts/s10-expected.js 2015-05-27 12:15:09.000000000 +0000 @@ -1 +1 @@ -function initScript(){var a=parseXML("config.xml").getElementsByTagName("config");var b=parseXML('konfig.xml').getElementsByTagName('konfig');var c='conf.xml';var e='conf';var d=parseXML(c).getElementsByTagName(e)} \ No newline at end of file +function initScript(){var c=parseXML("config.xml").getElementsByTagName("config");var e=parseXML('konfig.xml').getElementsByTagName('konfig');var b='conf.xml';var a='conf';var d=parseXML(b).getElementsByTagName(a)} \ No newline at end of file diff -Nru libjavascript-packer-perl-1.006003/t/scripts/s2-expected.js libjavascript-packer-perl-2.00/t/scripts/s2-expected.js --- libjavascript-packer-perl-1.006003/t/scripts/s2-expected.js 2012-02-28 12:00:05.000000000 +0000 +++ libjavascript-packer-perl-2.00/t/scripts/s2-expected.js 2015-05-27 12:15:09.000000000 +0000 @@ -1,2 +1,2 @@ -function(b){var a='blah blubb';var d=3;alert(a);var f=1;//@a -var e=b;/*@abcd var f=1;@*/abcd var c=$H()};/*@abcd var x=1;@*/ \ No newline at end of file +function(c){var a='blah blubb';var e=3;alert(a);var d=1;//@a +var b=c;/*@abcd var d=1;@*/abcd var f=$H()};/*@abcd var x=1;@*/ \ No newline at end of file diff -Nru libjavascript-packer-perl-1.006003/t/scripts/s3-expected.js libjavascript-packer-perl-2.00/t/scripts/s3-expected.js --- libjavascript-packer-perl-1.006003/t/scripts/s3-expected.js 2012-02-28 12:01:35.000000000 +0000 +++ libjavascript-packer-perl-2.00/t/scripts/s3-expected.js 2015-05-27 12:15:09.000000000 +0000 @@ -1 +1 @@ -eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[024-9]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('2(b){0 a=\'7 9\';0 d=3;8(a);0 6=1;//@a\n0 e=b;/*@4 0 6=1;@*/4 0 c=$5()};',[],10,'var||function||abcd|H|f|blah|alert|blubb'.split('|'),0,{})) \ No newline at end of file +eval(function(p,a,c,k,e,r){e=String;if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'[024-9]'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5(c){0 a=\'2 9\';0 e=3;8(a);0 d=1;//@a\n0 b=c;/*@4 0 d=1;@*/4 0 6=$7()};',[],10,'var||blah||abcd|function|f|H|alert|blubb'.split('|'),0,{})) \ No newline at end of file diff -Nru libjavascript-packer-perl-1.006003/t/scripts/s4-expected.js libjavascript-packer-perl-2.00/t/scripts/s4-expected.js --- libjavascript-packer-perl-1.006003/t/scripts/s4-expected.js 2012-02-28 12:01:40.000000000 +0000 +++ libjavascript-packer-perl-2.00/t/scripts/s4-expected.js 2015-05-27 12:15:09.000000000 +0000 @@ -1,2 +1,2 @@ -function(b){var a='blah blubb';var d=3;alert(a);var f=1;//@a -var e=b;/*@abcd var f=1;@*/abcd var c=$H()};/*@abcd var x=1;@*/ \ No newline at end of file +function(c){var a='blah blubb';var e=3;alert(a);var d=1;//@a +var b=c;/*@abcd var d=1;@*/abcd var f=$H()};/*@abcd var x=1;@*/ \ No newline at end of file diff -Nru libjavascript-packer-perl-1.006003/t/scripts/s5-expected.js libjavascript-packer-perl-2.00/t/scripts/s5-expected.js --- libjavascript-packer-perl-1.006003/t/scripts/s5-expected.js 2012-02-28 12:01:46.000000000 +0000 +++ libjavascript-packer-perl-2.00/t/scripts/s5-expected.js 2015-05-27 12:15:09.000000000 +0000 @@ -1 +1 @@ -eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([2-9h-zB-Z]|1[0-9a-zA-Z])'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 I=7 3(){5 c=7 Y();5 d=3(g){8(!g.2(\'F\'))n;7 B.u(\'/9\'+g.2(\'F\')+\'x.w?\'+6.h(6.l()*m)+\'=\'+6.h(6.l()*m),{v:\'2\',y:3(a){5 f=7 K(\'R\').o(a.t.1k());f.1j(\'1c\').s(3(b){5 e=7 1b();e.N=b.10(\'N\');c[c.J]=e})}});8(g.2(\'L\')){g.2(\'L\').s(3(e){d(e)})}}n{Q:3(){5 b=C.U();b.s(3(e){d(e)})}}}5 9=7 3(){n{r:3(){5 g=$A(9.r.14);5 a=g.1d();8(!a){n}5 f=7 K(\'R\');f.13({\'19\':\'M\',\'1o\':\'M\'});8( $(\'i\').18()){7 q.1a(\'i\',{11:3(){7 B.u(\'/9\'+a+\'x.w?\'+6.h(6.l()*m)+\'=\'+6.h(6.l()*m),{v:\'2\',y:3(e){5 b=f.o(e.t); $(\'i\').o(b);7 q.G(\'i\',{H:0.E})}})},15:0.E})}O{7 B.u(\'/9\'+a+\'x.w?\'+6.h(6.l()*m)+\'=\'+6.h(6.l()*m),{v:\'2\',y:3(e){ $(\'i\').o(f.o(e.t));7 q.G(\'i\',{H:0.12})}})}}}}5 j=0;T.4.17({D:3(e){n 1i.D(e)},X:3(e){n e.16()}});3 p(b,e){b=b?b:\'/\';8(!j&&b){j=1;9.r(b);C.r(b);z()}}3 1h(b,e){8(!j){4.S(b,e)}p(b,e)}3 z(){5 e=$A(q.1f);8(e.J>0){Z("z();",1n)}O{j=0}}T.1m=3(){4.1e();4.1l(p);C.V();k=4.1g();k=k?k:\'/\';8(4.W()){8(!j){4.S(k,P)}p(k,P)}I.Q()}',[],87,'||get|function|dhtmlHistory|var|Math|new|if|content||||||||round|div_content|wait|initialLocation|random|99999|return|update|handle_location|Effect|process|each|responseText|Request|method|htm|index|onComplete|reset_wait||Ajax|menu|toJSON|01|loc|Appear|from|image|length|Element|subs|0px|src|else|null|preload|div|add|window|get_menu_hash|init|isFirstLoad|fromJSON|Array|setTimeout|readAttribute|afterFinish|00|setStyle|arguments|to|evalJSON|create|visible|padding|Fade|Image|img|shift|initialize|Queue|getCurrentLocation|handle_click|Object|select|stripScripts|addListener|onload|1000|margin'.split('|'),0,{})) \ No newline at end of file +eval(function(p,a,c,k,e,r){e=function(c){return(c<62?'':e(parseInt(c/62)))+((c=c%62)>35?String.fromCharCode(c+29):c.toString(36))};if('0'.replace(0,e)==0){while(c--)r[e(c)]=k[c];k=[function(e){return r[e]||e}];e=function(){return'([2-9h-zB-Z]|1[0-9a-zA-Z])'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('5 L=7 3(){5 g=7 W();5 f=3(e){9(!e.4(\'N\'))l;7 s.t(\'/h\'+e.4(\'N\')+\'w.v?\'+6.m(6.k()*8)+\'=\'+6.m(6.k()*8),{y:\'4\',z:3(d){5 c=7 G(\'I\').o(d.C.1m());c.1i(\'1a\').u(3(b){5 a=7 Y();a.Q=b.1h(\'Q\');g[g.M]=a})}});9(e.4(\'R\')){e.4(\'R\').u(3(a){f(a)})}}l{P:3(){5 b=x.18();b.u(3(a){f(a)})}}}5 h=7 3(){l{r:3(){5 c=$A(h.r.13);5 e=c.1l();9(!e){l}5 d=7 G(\'I\');d.1j({\'1g\':\'E\',\'1e\':\'E\'});9( $(\'i\').1o()){7 p.X(\'i\',{12:3(){7 s.t(\'/h\'+e+\'w.v?\'+6.m(6.k()*8)+\'=\'+6.m(6.k()*8),{y:\'4\',z:3(a){5 b=d.o(a.C); $(\'i\').o(b);7 p.F(\'i\',{K:0.D})}})},1n:0.D})}J{7 s.t(\'/h\'+e+\'w.v?\'+6.m(6.k()*8)+\'=\'+6.m(6.k()*8),{y:\'4\',z:3(a){ $(\'i\').o(d.o(a.C));7 p.F(\'i\',{K:0.U})}})}}}}5 n=0;T.2.14({S:3(a){l Z.S(a)},16:3(a){l a.15()}});3 q(b,a){b=b?b:\'/\';9(!n&&b){n=1;h.r(b);x.r(b);B()}}3 19(b,a){9(!n){2.H(b,a)}q(b,a)}3 B(){5 a=$A(p.10);9(a.M>0){1k("B();",V)}J{n=0}}T.1f=3(){2.1c();2.11(q);x.1b();j=2.17();j=j?j:\'/\';9(2.1d()){9(!n){2.H(j,O)}q(j,O)}L.P()}',[],87,'||dhtmlHistory|function|get|var|Math|new|99999|if||||||||content|div_content|initialLocation|random|return|round|wait|update|Effect|handle_location|process|Ajax|Request|each|htm|index|menu|method|onComplete||reset_wait|responseText|01|0px|Appear|Element|add|div|else|from|image|length|loc|null|preload|src|subs|toJSON|window|00|1000|Array|Fade|Image|Object|Queue|addListener|afterFinish|arguments|create|evalJSON|fromJSON|getCurrentLocation|get_menu_hash|handle_click|img|init|initialize|isFirstLoad|margin|onload|padding|readAttribute|select|setStyle|setTimeout|shift|stripScripts|to|visible'.split('|'),0,{})) \ No newline at end of file diff -Nru libjavascript-packer-perl-1.006003/t/scripts/s8-expected.js libjavascript-packer-perl-2.00/t/scripts/s8-expected.js --- libjavascript-packer-perl-1.006003/t/scripts/s8-expected.js 2011-01-27 06:37:22.000000000 +0000 +++ libjavascript-packer-perl-2.00/t/scripts/s8-expected.js 2015-05-27 12:15:09.000000000 +0000 @@ -1 +1 @@ -function(b){var d=x;var c=y;var a=(function(){return[].concat(arguments)[0][0]!==1})(1,do_somthing(do_something_else(d,c),d));if(a)arrayProto.concat=concat} \ No newline at end of file +function(d){var b=x;var c=y;var a=(function(){return[].concat(arguments)[0][0]!==1})(1,do_somthing(do_something_else(b,c),b));if(a)arrayProto.concat=concat} \ No newline at end of file