Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

eval w/ file name/line number or jscript from jscript

0 views
Skip to first unread message

nlloyds

unread,
Sep 26, 2009, 2:09:02 PM9/26/09
to
Hi,

I'm working on creating a wscript/jscript engine for Narwhal (http://
narwhaljs.org, http://github.com/smith/narwhal-wscript/blob/master/bootstrap.js),
and I'm trying to figure something out. Sorry if it's been addressed
on this group before: I'm new here and couldn't find anything by
searching.

When calling eval from a script, if the text being evaluated has an
error, the scripting engine will always report the error as occurring
in the file and line where the eval happened.

Is there any way to read a file, evaluate its contents, and have the
engine report errors at the place in the file they happened?

I've tried doing new ActiveXObject("JScript") from a JScript file,
thinking about the possibility of using another scripting engine from
within to open and evaluate files, but haven't had any luck calling
methods on the object that gets created.

Any advice would be appreciated.

Thanks,

Nathan

0 new messages