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

Fix path lookup inside helpers #707

Merged
merged 3 commits into from
Oct 13, 2017
Merged

Fix path lookup inside helpers #707

merged 3 commits into from
Oct 13, 2017

Conversation

tomdale
Copy link
Contributor

@tomdale tomdale commented Oct 13, 2017

Fixes #705

MustacheExpressions generate a get opcode in cases where the identifier is statically found in their scope, but fall back to maybeLocal otherwise to disambiguate at compile time whether they are being invoked inside a partial or not.

PathExpressions however did not go through this path, always using a get opcode even in cases that were ambiguous. This caused any PathExpression inside a partial to fail when inheriting an identifier from the outside scope.

This PR changes the PathExpression compiler to generate a maybeLocal opcode in the ambiguous case instead of a get.

Dennis Stumm and others added 3 commits October 13, 2017 10:33
…biguous cases

MustacheExpressions generate a `get` opcode in cases where the identifier is statically found in their scope, but fall back to `maybeLocal` otherwise to disambiguate at compile time whether they are being invoked inside a partial or not.

PathExpressions however did not go through this path, always using a `get` opcode even in cases that were ambiguous. This caused any PathExpression inside a partial to fail when inheriting an identifier from the outside scope.

This commit changes the PathExpression compiler to generate a `maybeLocal` opcode in the ambiguous case instead of a `get`.
@chancancode
Copy link
Contributor

Looks good to me. As far as I can tell, we just forgot to do it in 702d1de

@chancancode chancancode merged commit 7f188c7 into master Oct 13, 2017
@chancancode chancancode deleted the fix-partial-helpers branch October 13, 2017 19:03
@Turbo87 Turbo87 added the bug label Oct 22, 2017
@GavinJoyce
Copy link
Contributor

GavinJoyce commented Oct 27, 2017

@tomdale
Copy link
Contributor Author

tomdale commented Oct 31, 2017

@GavinJoyce The regression was fixed on the Ember.js side in emberjs/ember.js#15777, right, and there is nothing we need to do on the Glimmer VM side?

@GavinJoyce
Copy link
Contributor

GavinJoyce commented Oct 31, 2017

@tomdale yes, this was fixed in Ember in emberjs/ember.js#15777

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.

4 participants