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

Inconsistency between function and non-function scope binding #74

Open
chriskrycho opened this issue May 29, 2020 · 2 comments
Open

Inconsistency between function and non-function scope binding #74

chriskrycho opened this issue May 29, 2020 · 2 comments

Comments

@chriskrycho
Copy link
Contributor

Expected: any value in scope is accessible in templates.

Actual: functions in scope are accessible (as modifiers or helpers), but other values are not.

Here's a minimal reproduction playground.

@chiragpat
Copy link
Collaborator

Hey Chris,

The expectation is only invokable's i.e. Components and helpers are retrieved from scope. We can potentially add some docs clarifying this. The VM currently only lets us resolve invokable's and not necessarily any free variables in scope.

Chirag

@chriskrycho
Copy link
Contributor Author

Thanks for the quick reply! I think adding docs would help a bunch, and I can author a PR to that effect early next week if you like.

I also think we should look at making tweaks to the VM, though, because the behavior here is quite surprising—and I expect it will be particularly surprising for anyone coming from e.g. React.

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