jrburke/almond — Issue #6: require()'ing a missing dependency returns null instead of throwing
Author: pmuellr
Created: 2011-12-07 19:16:49+00:00
State: open

From the AMD spec: https://github.com/amdjs/amdjs-api/wiki/require

Under "require(String)" is the note:

> It MUST throw an error if the module has not already been loaded and evaluated.

Currently, it seems to return null. I'd actually prefer that to be the "standard", but since other `require()`s do throw errors, I think almond should also.

Bonus, it would be awesome to get a nice exception message for this:

Module 'xyz' not defined, but load attempted from module 'abc'

Personally, I'd just throw that message string (not bother with an "error object"). I consider this to be a development time error, so it doesn't need to be the spec-iest thing around, just useful.