glimmer-vm
glimmer-vm copied to clipboard
if expression does not prevent evaluation of values
I discovered that (Ember 3.25) when I attempted to prevent the (fn …) from helper from evaluating to prevent the non-function assertion it still evaluated.
<MyComponent @myAction={{if @maybeFunction (fn @maybeFunction "foobar")}} />
Expected
To allow the value for @myAction to resolve to undefined.
Actual
An assertion is thrown:
Error: You must pass a function as the
fnhelpers first argument, you passed undefined.
I think this is a duplicate of this ember issue? https://github.com/emberjs/ember.js/issues/19610
It seems the docs explicitly mention this behavior so it works as intended :smile:.