kitsonk/dojo — comment on commit ba9465fcd1207b12a056a8f91ff76f27d976c6f9
File: parser.js line 775
By kitsonk:

You are right... it is returning the wrong list.

I am now doing the following and it returns the proper results, but I do run into a race condition where if there are truly no modules to load, the code executes synchronously and it means that the results is overwritten with proper results, but then we lose the results.then function. I tried a few ways to figure it out, but I am stumped on how we can continue to return the proper then function composited with the proper array.

```js
results.then = d.then(function(list) {
// Propagate the settings to the children
list = self.propagateChildren(root, list, options);

// Instantiate the nodes and return the objects
var mixin = options.template ? {template: true} : {};

return results = self._instantiate(list, mixin, options);
}).then;

// Return the combination of the array (if it's available) and the Deferred
return results;
```