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

Strict mode: helpers inside attribute concats are not auto-invoked #1572

Open
chancancode opened this issue Mar 8, 2024 · 2 comments
Open

Comments

@chancancode
Copy link
Contributor

chancancode commented Mar 8, 2024

{{!-- works in standalone hbs --}}
<div class="it {{works}}" />
{{!-- does not work in gjs, calls Function.prototype.toString instead --}}
function works() {
  return "works";
}

<template>
  <div class="it {{works}}" />
</template>

Strict mode RFC only intended the change for arguments, not attributes: https://github.com/emberjs/rfcs/blob/508ac9b95bf2a4b397bf72b8e51d981c14c42535/text/0496-handlebars-strict-mode.md#3-no-implicit-invocation-of-argument-less-helpers

@patricklx
Copy link
Contributor

mmm, and what about
{{(works)}}?

@chancancode
Copy link
Contributor Author

Yep it does, but it is a bug that it is necessary; also makes codemods (or just manual migration) etc harder when there are inconsistencies like these

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