On Tue Apr 06 02:19:44 2010, ptizoom wrote:
Show quoted text> Thanks for the help.
> before I send all the stuff attached to the page,I thought that:
>
> -I might need some basic libraries to run this?
> how about hooking the js.jar ?
>
> -also, how to printout compiler activities and show the last lines
> beeing (multi)processed?
> can I use log4j.jar?
I don’t know what either of those libraries is, but since they end with ‘.jar’, I suspect they
have something to do with Java (am I right?), which is an area with which I am very unfamiliar.
To save the scripts attached to the page, you can use Firefox’s ‘Web page, complete’ option
when saving the page. Alternately you could use an LWP handler to print all the URLs:
$w = new WWW::Scripter;
$w->add_handler(request_send => sub { print "Fetching ",shift->uri, "\n" };
To see which lines of JavaScript are being run with JE, a bit of elaborate hackery is required,
as JE doesn’t have such a feature yet:
use Hook::WrapSub 'wrap_subs';
require JE::Code;
wrap_subs
sub {
return if $_[0][1] eq 'statements' or $_[0][1] eq 'function';
my @pos = @{$_[0][0]};
my $substr
= substr ${$JE::Code::code->{source}}, $pos[0], $pos[1]-$pos[0];
$substr =~ /[\n\r]\s*\S/ and substr $substr,$-[0] =>= "...\n";
$JE::Code::pos = $pos[0];
print JE::Code::add_line_number(
'Executing [ '
. $substr
. " ]"
);
},
'JE::Code::Statement::eval';