wycats/handlebars.js — pull request #797 by tomdale (2014-05-13 12:36:57+00:00)
Title: Pass full helper ID to helperMissing when options are provided

Presently, there is an inconsistency in how helper names are reported to `helperMissing`/`blockHelperMissing`.

For example, take the following block helper:

```handlebars
{{#nested/foo-bar}}{{/nested/foo-bar}}
```

Because there is ambiguity here (`nested/foo-bar` may either be a helper or a property path available on the context), it must be resolved at runtime, which is done via the `blockValue` opcode. If there is no `nested/foo-bar` property present, the `blockHelperMissing` hook will be invoked, with the name of the helper passed as the full ID: `nested/foo-bar`.

However (I think due to the recent sexp work, but it may have been there before), introducing hash arguments causes two changes:

1. `helperMissing` is invoked instead of `blockHelperMissing`
2. The helper name is reported as `foo-bar` instead of `nested.foo-bar`

In other words, changing `{{#nested/foo-bar}}{{/nested/foo-bar}}` to `{{#nested/foo-bar name="Steve"}}{{/nested/foo-bar}}` changes which "helper missing" hook is invoked, as well as the arguments passed to it.

## helperMissing vs. blockHelperMissing

Simply adding hash arguments disambiguates whether the mustache is a helper or not. In the case where hash args are present, Handlebars takes a shortcut, eliminates the `blockValue` opcode, and skips directly to `invokeHelper`. I would argue that `invokeHelper` should invoke `blockHelperMissing` instead of `helperMissing` when there's a program provided, but there may be something I'm missing here and this PR doesn't change these semantics.

## Full ID vs. truncated ID

This issue is fatal for Ember because we use `helperMissing`/`blockHelperMissing` to look up components, which may be nested. Because of this issue, using the `{{nested/my-component}}` component will work, but `{{nested/my-component name="Steve"}}` will not.

This PR address this issue by passing the original, non-truncated ID to `helperMissing`, matching the semantics of `blockHelperMissing`.