-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BUGFIX beta] Fix block params named
component
...and `input`, `outlet`, etc. Block params (local variables) should always win over helpers and built-in syntaxes. Fixes #14413
- Loading branch information
1 parent
8c8062a
commit 38f3172
Showing
4 changed files
with
73 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
packages/ember-glimmer/tests/integration/refinements-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { RenderingTest, moduleFor } from '../utils/test-case'; | ||
import { strip } from '../utils/abstract-test-case'; | ||
import { set } from 'ember-metal'; | ||
|
||
moduleFor('syntax refinements', class extends RenderingTest { | ||
['@test block params should not be refined']() { | ||
this.registerHelper('foo', () => 'bar helper'); | ||
|
||
this.render(strip` | ||
{{#with var as |foo|}} | ||
{{foo}} | ||
{{/with}} | ||
--- | ||
{{#with var as |render|}} | ||
{{render}} | ||
{{/with}} | ||
--- | ||
{{#with var as |outlet|}} | ||
{{outlet}} | ||
{{/with}} | ||
--- | ||
{{#with var as |mount|}} | ||
{{mount}} | ||
{{/with}} | ||
--- | ||
{{#with var as |component|}} | ||
{{component}} | ||
{{/with}} | ||
--- | ||
{{#with var as |input|}} | ||
{{input}} | ||
{{/with}} | ||
--- | ||
{{#with var as |-with-dynamic-vars|}} | ||
{{-with-dynamic-vars}} | ||
{{/with}} | ||
--- | ||
{{#with var as |-in-element|}} | ||
{{-in-element}} | ||
{{/with}}`, { var: 'var' }); | ||
|
||
this.assertText('var---var---var---var---var---var---var---var'); | ||
|
||
this.runTask(() => set(this.context, 'var', 'RARRR!!!')); | ||
|
||
this.assertText('RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!---RARRR!!!'); | ||
|
||
this.runTask(() => set(this.context, 'var', 'var')); | ||
|
||
this.assertText('var---var---var---var---var---var---var---var'); | ||
} | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters