Skip to content

Commit 87fa534

Browse files
Fix incorrect transform of naked pre-existing this (#41)
* Failing test for #30 * Resolve #30
1 parent 7d7e035 commit 87fa534

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

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
@@ -6,4 +6,5 @@
66
{{my-component (my-helper property)}}
77
{{my-component (my-helper "string")}}
88
{{my-component (my-helper 1)}}
9+
{{get this 'key'}}
910

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
{{my-component (my-helper this.property)}}
77
{{my-component (my-helper "string")}}
88
{{my-component (my-helper 1)}}
9-
9+
{{get this 'key'}}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ function transformPlugin(env, runtimeData, options = {}) {
3434
ElementNode: paramTracker,
3535
PathExpression(ast) {
3636
if (ast.data) return;
37+
if (ast.original === 'this') return;
3738

3839
let token = ast.parts[0];
3940

0 commit comments

Comments
 (0)