ember-estree 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/parse.js +8 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-estree",
3
- "version": "0.5.0",
3
+ "version": "0.5.1",
4
4
  "description": "ESTree generator for gjs and gts file used by ember",
5
5
  "keywords": [
6
6
  "AST",
package/src/parse.js CHANGED
@@ -182,7 +182,14 @@ export function toTree(source, options = {}) {
182
182
  // configured we re-enter the walk manually via `visit()` to
183
183
  // dispatch them across the Glimmer nodes. With no handlers the
184
184
  // walk would be pure overhead, so just return the subtree.
185
- return hasVisitors ? visit(ast, null) : ast;
185
+ //
186
+ // Pass `state` (the placeholder's inherited parent context) so the
187
+ // Glimmer root's parentPath reflects its true JS parent. The
188
+ // placeholder (TemplateLiteral / StaticBlock) is an internal
189
+ // artifact — the GlimmerTemplate logically lives where the
190
+ // placeholder was, so its parent is e.g. VariableDeclarator or
191
+ // ClassBody, not the placeholder itself.
192
+ return hasVisitors ? visit(ast, state) : ast;
186
193
  }
187
194
  }
188
195