View Full Version : [FIXED-EXTJSIV-307] Ext.Loader.getPath() returning garbage

24 Mar 2011, 7:18 AM
When Ext.Loader.getPath() is called for a class with an unknown prefix, the method returns garbage. For instance:

// necessary initializations
Ext.Loader.getPath('Ext.util.Observable'); // => /js/externals/ext4/src/util/Observable.js
Ext.Loader.getPath('foo.bar'); // => undefined/ar/foo.js

Returning null or throwing an exception would be much better, in my opionion.

24 Mar 2011, 7:23 AM
Dupe? http://www.sencha.com/forum/showthread.php?127805-Ext.require-add-error-for-not-found-resources

24 Mar 2011, 7:52 AM
Not necessarily. The getPath() method can be used without actually loading anything. I now use Ext.Loader.config.paths.hasOwnProperty('foo') to see if a namespace was registered, which works just fine but still looks a little hacky.

Jacky Nguyen
25 Mar 2011, 11:59 AM
This has been fixed, thank you for reporting