duojs / duo

A next-generation package manager for the front-end
3.42k stars 118 forks source link

bug in method findRoot #423

Open zhangaz1 opened 9 years ago

zhangaz1 commented 9 years ago

case ignor

此处可以统一转成大写或小写在做对比,不然有可能因为大小写不匹配死循环,我为这个问题浪费了半天时间,还以为不支持'./another.js'引用呢,差点就放弃duo了

stephenmathieson commented 9 years ago

english? i don't think any of @duojs/owners speak chinese

zhangaz1 commented 9 years ago

1: root = 'e:\temp'; path = 'e:\Temp\main.js'; then the while loop will endless when path = 'e:\', because: 'e:\temp' != 'e:\Temp' so: should Ignore path insensitive.

2: root = 'e:\temp\'; path = 'e:\temp\main.js'; then the while loop will endless when path = 'e:\', because: 'e:\temp\' != 'e:\temp' so: should consider the path end of "\" or not.

3: better check the path value Inside the loop, when path === dirname (path) throw an excpetion. otherwise it will endless.

~~my poor english(60% by http://fanyi.baidu.com/translate), I hope you can understand.

stephenmathieson commented 9 years ago

i will try to reproduce this bug, but am worried about the implications on case sensitive systems (unix).