I try to use empty url or url with no '/' and it failed (splitPoint = -1). I first replace by a test, then I by the +1 because I think the behavior match web convention : 
* url == '' => baseUrl = '' assetUrl = ''
* url == 'toto.xxx' => baseUrl = '' assetUrl = 'toto.xxx'
* url == '/toto.xxx' => baseUrl ='/' assetUrl = 'toto.xxx'
* url == 'zzzz/toto.xxx' => baseUrl = 'zzzz/' assetUrl='toto.xxx'
(in the commit's comment)