mikemaccana/agave — pull request #4 by Rich-Harris (2013-10-22 10:56:49+00:00)
Title: keep track of which prefixes agave has already been enabled for, prevent re-enabling

Just a small optimisation - if my app has dependencies which use Agave methods, those methods are called before the app initialises, and so they don't exist yet. The obvious solution is to `require` Agave at the top of each of those modules...

```js
define( function ( require ) {
'use strict';
require( 'agave' ).enable();

var someDependency = { /*...*/ };
return someDependency;
});
```

...but that causes all the methods to be recreated unnecessarily. This commit short-circuits that, meaning I can sprinkle my modules with `require( 'agave' ).enable()` guilt-free.