glimmerjs / glimmer-vm

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

if expression does not prevent evaluation of values

sukima opened this issue · comments

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 fn helpers first argument, you passed undefined.

I think this is a duplicate of this ember issue? emberjs/ember.js#19610

It seems the docs explicitly mention this behavior so it works as intended 😄.