Open Saranya-Raaj opened 8 years ago
This seems correct to me.
@mixonic / @mmun - Any objections?
we should be careful about perf
I second Stef's concern, get
can be called a pretty significant amount of times.
We already lookup helpers for curlies that appear outside of attributes: https://github.com/tildeio/htmlbars/blob/master/packages/htmlbars-runtime/lib/hooks.js#L698. Doing it for attributes as well is the correct thing to do.
That said, I don't like this particular implementation. get
should not be looking up helpers.
In {{foo bar}}
, bar
is never a helper, but with this implementation we would be checking if it was. Instead, we should add an ambiguous
hook that delegates get
or subexpr
depending on whether the path resolves to a helper or not. The ambiguous
hook would be called whenever there was a {{foo}}
in the template (whether in content or in an attribute). {{foo.bar}}
should not trigger the ambiguous
hook however.
fixes emberjs/ember.js#12506