mozilla-b2g/gaia — pull request #18476 by jrburke (2014-04-20 20:24:48+00:00)
Title: Bug 998799 - alameda.js depends toString()-ing functions

Makes sure to normalize define() calls even with an r.js uglify-style minification (which auto-normalizes) is not done. Should help test scenarios for Tarako, where Function toString may not be available.

For reviewers, this change just does one of the steps that was automatically done by r.js whenever the r.js build config had a value other than `optimize: 'none'`, so this sort of change has already been tested if doing those minify-opitmized builds. This change just does that work even if optimize is set to 'none'.

If the travis build passes, that should be enough of an indication that this change is safe, as it just affects how dependencies are passed to the define() calls. So, if the module did this in source form:

```javascript
define(function(require) {
var a = require('a');
});
```

This setting uses an AST to find those require calls, then transform the define call to this form, for the modules placed in build_stage:

```javascript
define(['require', 'a'], function(require) {
var a = require('a');
});
```