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

Ensure {{component.name}} works with implicit this fallback in loose mode. #1249

Merged
merged 2 commits into from
Dec 21, 2020

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Dec 21, 2020

Initial attempts to reproduce emberjs/ember.js#19313

* Using a named argument of `@component` is valid, as is using paths off
  of it.
* Using an implicit this fallback of `component.name` is valid for paths
@rwjblue rwjblue force-pushed the repro-emberjs-19313 branch from 3d1ed89 to 1e2e4e8 Compare December 21, 2020 22:56
When in loose mode referencing `{{component.name}}` **must** mean
relying on implicit this fallback as `{{this.component.name}}`. The
existing code always assumes that any `PathExpression` _starting_ with a
keyword name (as its first path part) **must** be a keyword invocation.

This change ensures that `{{component.name}}` can properly fallback to
`{{this.component.name}}` when running in loose mode, and emits a
helpful error when running in strict mode.
@rwjblue rwjblue force-pushed the repro-emberjs-19313 branch from 1e2e4e8 to e0df20a Compare December 21, 2020 23:29
@pzuraq pzuraq merged commit c607553 into master Dec 21, 2020
@pzuraq pzuraq deleted the repro-emberjs-19313 branch December 21, 2020 23:44
@rwjblue rwjblue added bug and removed internal labels Dec 21, 2020
@rwjblue rwjblue changed the title Add test for usage of {{@component.foo}} Ensure {{component.name}} works with implicit this fallback in loose mode. Dec 21, 2020
@lifeart
Copy link
Contributor

lifeart commented Dec 22, 2020

wondering, should we add same check for this.component ?

@rwjblue
Copy link
Member Author

rwjblue commented Dec 23, 2020

wondering, should we add same check for this.component ?

@lifeart - What do you mean?

@lifeart
Copy link
Contributor

lifeart commented Dec 23, 2020

@rwjblue I mean this.component is not recognized as component helper

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

Successfully merging this pull request may close these issues.

3 participants