Skip to content

Distinguish instance- from direct-invokable types #59

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

Merged
merged 2 commits into from
Mar 11, 2021
Merged

Conversation

dfreeman
Copy link
Member

Currently the two types of resolvable value are Invokable<T> and new () => Invokable<T>. This largely works well, with one main exception: it makes {{this}} look like an invokable value in component templates, since the instance type is itself Invokable<T>.

To fix this, we can distinguish between the normal case of invokable values that are wrapped in a constructor (which covers user-defined components, helpers and modifiers) and "direct invokable" values that are largely used internally to represent intrinsics like {{each}} and {{fn}}.

Plain function usage, as in GlimmerX, is unaffected by this change.

@dfreeman dfreeman added the bug Something isn't working label Mar 11, 2021
@dfreeman dfreeman merged commit 0b0926f into master Mar 11, 2021
@dfreeman dfreeman deleted the direct-invokable branch March 11, 2021 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant