Skip to content

Commit 5f6ae02

Browse files
Fix @Args swapped with this.args (#40)
* Add failing test * Resolve #35
1 parent e3e4c1c commit 5f6ae02

3 files changed

Lines changed: 4 additions & 0 deletions

File tree

transforms/no-implicit-this/__testfixtures__/handlebars-with-positional-params.input.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{my-component "string"}}
22
{{my-component 1}}
33
{{my-component foo}}
4+
{{my-component @foo}}
45
{{my-component property}}
56
{{my-component (my-helper property)}}
67
{{my-component (my-helper "string")}}

transforms/no-implicit-this/__testfixtures__/handlebars-with-positional-params.output.hbs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{{my-component "string"}}
22
{{my-component 1}}
33
{{my-component this.foo}}
4+
{{my-component @foo}}
45
{{my-component this.property}}
56
{{my-component (my-helper this.property)}}
67
{{my-component (my-helper "string")}}

transforms/no-implicit-this/helpers/plugin.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ function transformPlugin(env, runtimeData, options = {}) {
3333
Program: paramTracker,
3434
ElementNode: paramTracker,
3535
PathExpression(ast) {
36+
if (ast.data) return;
37+
3638
let token = ast.parts[0];
3739

3840
if (token !== 'this') {

0 commit comments

Comments
 (0)