Skip to content

[BUGFIX beta] Assert when local variables shadow modifier invocations#17137

Merged
rwjblue merged 1 commit intomasterfrom
assert-local-variable-shadowing-modifier-invocation
Oct 20, 2018
Merged

[BUGFIX beta] Assert when local variables shadow modifier invocations#17137
rwjblue merged 1 commit intomasterfrom
assert-local-variable-shadowing-modifier-invocation

Conversation

@chancancode
Copy link
Copy Markdown
Member

Expanding #17132 to cover modifiers.

{{#let this.foo as |foo|}}
  <div {{foo}} />
         ~~~ shadowed modifier invocation!
{{/let}}

Previously, this would have tried to resolve and invoke the modifier foo, ignoring the presence of the foo local variable. This is inconsistent with our general lexical lookup rules. This is now an error (assertion).

This paves the way for allowing "contextual modifiers" in the future, where the local variable foo contains an invocable modifier value.

Expanding #17132 to cover modifiers.

```hbs
{{#let this.foo as |foo|}}
  <div {{foo}} />
         ~~~ shadowed modifier invocation!
{{/let}}
```

Previously, this would have tried to resolve and invoke the modifier `foo`,
ignoring the presence of the `foo` local variable. This is inconsistent
with our general lexical lookup rules. This is now an error (assertion).

This paves the way for allowing "contextual modifiers" in the future, where
the local variable `foo` contains an invocable modifier value.
@chancancode chancancode force-pushed the assert-local-variable-shadowing-modifier-invocation branch from b85c38c to 74b8f60 Compare October 20, 2018 01:38
@rwjblue rwjblue merged commit 6d57f74 into master Oct 20, 2018
@rwjblue rwjblue deleted the assert-local-variable-shadowing-modifier-invocation branch December 4, 2018 20:57
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

Successfully merging this pull request may close these issues.

2 participants