gruntjs/grunt-contrib-handlebars — pull request #123 by mpneuried (2014-10-30 20:49:10+00:00)
Title: Fixed base namespace code position and return

Changes
- always write the base namespace to the top
- for commonjs return the first namespace

My usecase looks like:
```coffee
handlebars:
options:
namespace: ( filename )->
names = filename.replace(/_src_static\/(.*)(\/\w+\.hbs)/, '$1')
return names.split('/').join('.')
processName: ( filePath )->
return path.basename(filePath, '.hbs')
partialRegex: /.*/,
partialsPathRegex: /\/partials\//
partialsUseNamespace: true
commonjs: true
```

The result, without my changes would look like:

```js
module.exports = function(Handlebars) {

this["jst"]["partials"] = this["jst"]["partials"] || {};

Handlebars.registerPartial("block", /* reduced */, "useData":true}));

// WRONG: This should be at the top
this["jst"] = this["jst"] || {};

this["jst"]["modules"] = /* reduced */

this["jst"]["utils"] = this["jst"]["utils"] || {};

this["jst"]["utils"]["modules"] = /* reduced */

// WRONG: it should return the basic namespace or only this
return this["jst"]["utils"];

};
```