Subject: | Request for the 'eval_file' method |
Hi, Thomas,
I'd love to see a new method named "eval_file" because I really need it
ATM. I think it is NOT as simple as the following:
use File::Slurp;
sub eval_file {
my ($self, $filename) = @_;
$self->eval(read_file($filename));
}
Because we still need to reset the file name and line number in the
spidermonkey engine. Or the positional info contained in the diagnostics
produced by J::SM will be meaningless.
Also, the existing 'eval' method sets the starting line number to 0,
resulting in bogus positional info in diagnostics. Like this:
Error: ReferenceError: include is not defined at line 0: (null)
Thanks!
agentz