Problem with circular refs and ".." in the module path.

3 views
Skip to first unread message

Isaac Z. Schlueter

unread,
Dec 16, 2009, 4:15:50 PM12/16/09
to nodejs
Kris Zyp found an interesting bug where you can create a chain of
horribly unuseful errors if you have a circular dependency and one of
the modules has ".." in the name.

This patch fixes that.

http://github.com/isaacs/node/commit/a9218670bf276f4559cd0ed88be34fe307c1d5d0

Have fun!
--i

Ryan Dahl

unread,
Dec 18, 2009, 12:55:30 PM12/18/09
to nod...@googlegroups.com

It looks like you had a couple more commits on that branch? Can you
squash a bugfix for me? (A test would be really really cool :))

Isaac Z. Schlueter

unread,
Dec 19, 2009, 6:22:59 PM12/19/09
to nodejs
Ack, looks like there are issues.

I added some more extensive tests, and refactored the uri and path
modules to use the same normalization logic, so that nothing is
relying on flaky regexps.

http://gist.github.com/260278

Enjoy.

--i

On Dec 18, 9:55 am, Ryan Dahl <coldredle...@gmail.com> wrote:
> On 12/16/09, Isaac Z. Schlueter <i...@foohack.com> wrote:
>
> > Kris Zyp found an interesting bug where you can create a chain of
> >  horribly unuseful errors if you have a circular dependency and one of
> >  the modules has ".." in the name.
>
> >  This patch fixes that.
>

> >  http://github.com/isaacs/node/commit/a9218670bf276f4559cd0ed88be34fe3...

Ryan Dahl

unread,
Dec 22, 2009, 11:30:06 AM12/22/09
to nod...@googlegroups.com
On 12/20/09, Isaac Z. Schlueter <i...@foohack.com> wrote:
> Ack, looks like there are issues.
>
> I added some more extensive tests, and refactored the uri and path
> modules to use the same normalization logic, so that nothing is
> relying on flaky regexps.
>
> http://gist.github.com/260278

The patch includes test/mjsunit/circ-*.js which are not referenced in
any test and include setExports() which hasn't been commited. I
removed those tests. Otherwise looks good. Thanks.

http://github.com/ry/node/commit/4dcdfaf9291a5d6a2ed25b5742151a0de562a4a1

Reply all
Reply to author
Forward
0 new messages