jrburke/requirejs — pull request #959 by opichals (2013-11-26 14:54:45+00:00)
Title: trimDots copes with an empty path segment

Having baseUrl: '/base' and referencing '../dep' path from 'mod1' module and from another module 'mod2' using the the same '../dep' the 'dep' module actually loads twice.

Reason:
'/base/mod1/../dep'.split(/) ~ ['', 'base', 'mod1', '..', 'dep']
'/base/mod2/../dep'.split(/) ~ ['', 'base', 'mod2', '..', 'dep']

The trimDots() in its original version stopped on the first empty string path segment and let the resulting normalized module IDs differ.