mozilla/addon-sdk — pull request #428 by Gozala (2012-05-04 01:15:41+00:00)
Title: Bug 743359 - Extract parts of loader that will land to firefox into separate module

This change does following:

- Extracts most of the loader code into independent module loader.js that can be loaded using `Cu.import` or `require`.
- `loader.js` knows nothing about manifest it resolves all relative modules to `requirer.uri` and all non relative
modules to `loader.baseURI`.
- `ioService.newURI` is intentionally replaced by JS `resolve` function which is much faster as it does not has
to cross XPCOM boundary and in addition can be used to resolve non absolute URLs, that is used by a loader itself.
- All the built-in pseudo modules are cached by a resolved URI, this way no extra logic is required at load time to handle them in a special way.
- cuddlefish.js now loads loader.js and wraps it to pass-in SDK specific `resolve` function. Passed in `resolve`
function follows manifest for modules in manifest and delegates to loaders `resolve` function for modules that are not in manifest (system modules).
- Removed obsolete built-in `@loader` module.
- All SDK users of loader now use `cuddlefish` module.
- Fixed global `define` so that it interacts with a correct `sandbox`.