Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if expression does not prevent evaluation of values #1376

Open
sukima opened this issue Feb 1, 2022 · 1 comment
Open

if expression does not prevent evaluation of values #1376

sukima opened this issue Feb 1, 2022 · 1 comment

Comments

@sukima
Copy link

sukima commented Feb 1, 2022

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.

@Windvis
Copy link
Contributor

Windvis commented Feb 16, 2022

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 😄.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants