I miss-spoke. smjs does read() relative to the script's directory, and load() relative to the user's directory. That's exactly backwards from what I need. Hah!
On Nov 11, 9:34 am, Buck Golemon <[email protected]> wrote: > I'm trying to get jshint (http://www.jshint.com/) running at the > commandline under d8. To do this, I need to do two things. > > 1) Load the jshint library, which is a path relative to the cli > script, like "../jshint.js". > > 2) Read an input file, which (may be) a path relative to the users' > $PWD, like "./myproj/lib/neat_thing.js" > > For #2, I can use `os.system("readlink", ["-f", input_file])` to get > an absolute path to pass to read(). > > For #1, I'm completely stymied. Is there any way to do this? > > For the record, this is much easier under the spidermonkey console > (smjs). The load() function interprets paths as relative to the script > under execution, and I can get the users' $PWD with just > "environment.PWD". -- v8-users mailing list [email protected] http://groups.google.com/group/v8-users
