Hi,

Consider this: We execute script A, which loads script B, which
defines a function f that loads script C. B does not calls f, but A
does. Is C loaded relative to A because f is called from C or is C
relative to B because f is defined in B? The former should be rather
easy to implement in v8, but is not suitable to load library
functions. The latter requires more work. Given the current priorities
of the v8 team it will probably take a while (if ever) for this to
become a focused issue, especially since d8 is not supposed to be a
fully-fledged shell to begin with. We do accept contributions though!

Cheers,

Yang



On Nov 14, 6:51 pm, Buck Golemon <[email protected]> wrote:
> What is "adm" ?
>
> On Nov 14, 4:23 am, "Jokosuwito" <[email protected]> wrote:
>
>
>
>
>
>
>
> > Thank you adm.
>
> > -- pesan asli --
> > Subjek: [v8-users] Re: d8: relative and absolute paths
> > Dari: Yang Guo <[email protected]>
> > Tanggal: 14-11-2011 15.00
>
> > Currently, both read() and load() in d8 refer to $PWD. While I see the
> > problem you are having, I currently don't see an adequate solution
> > because d8 may take several input files, each residing inside a
> > different directory. It's not obvious which the path relative to the
> > cli script would be. Any suggestions?
>
> > -- Yang
>
> > On Nov 11, 8:41 pm, Buck Golemon <[email protected]> wrote:
>
> > > 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

-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users

Reply via email to