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

[BUGFIX release] local variable shadowing assert #17399

Merged
merged 1 commit into from
Dec 21, 2018
Merged

[BUGFIX release] local variable shadowing assert #17399

merged 1 commit into from
Dec 21, 2018

Conversation

chancancode
Copy link
Member

@chancancode chancancode commented Dec 20, 2018

Previously we considered the block params to shadow the params, hash, attributes and named arguments on the same block/element, which was incorrect.

For example:

{{#let (concat "foo" "bar") as |concat|}}
  ...
{{/let}}

In this case the assertion code incorrectly believed the concat in the sub-expression invocation was being shadowed. This is now fixed.

Also fixes a bug where we incorrectly transformed mustaches in attribute positions:

{{#let ... as |foo|}}
  <div class={{foo bar}} />
{{/let}}

...became...

{{#let ... as |foo|}}
  <div class={{component foo bar}} />
{{/let}}

This is clearly incorrect and has been fixed here as well.

Fixes #17370

@wycats wycats force-pushed the fix-assert branch 3 times, most recently from d25463b to 030f373 Compare December 20, 2018 21:14
Previously we considered the block params to shadow the params, hash,
attributes and named arguments on the same block/element, which was
incorrect.

For example:

```hbs
{{#let (concat "foo" "bar") as |concat|}}
  ...
{{/let}}
```

In this case the assertion code incorrectly believed the `concat` in
the sub-expression invocation was being shadowed. This is now fixed.

Also fixes a bug where we incorrectly transformed mustaches in attribute
positions:

```hbs
{{#let ... as |foo|}}
  <div class={{foo bar}} />
{{/let}}
```

...became...

```hbs
{{#let ... as |foo|}}
  <div class={{component foo bar}} />
{{/let}}
```

This is clearly incorrect and has been fixed here as well.

Fixes #17370
@rwjblue rwjblue merged commit adb1a35 into master Dec 21, 2018
@rwjblue rwjblue deleted the fix-assert branch December 21, 2018 03:00
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.

Wrong assertion for local variable shadowing helper
2 participants