ember-estree 0.6.9 → 0.6.10

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 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ember-estree",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "ESTree generator for gjs and gts file used by ember",
5
5
  "keywords": [
6
6
  "AST",
package/src/parse.js CHANGED
@@ -361,10 +361,16 @@ function toPlaceholderJS(source, parseResults) {
361
361
 
362
362
  parts.push(source.slice(cursor, start));
363
363
 
364
+ // Blank out backticks and dollar signs instead of backslash-escaping
365
+ // them: escaping grows the content, and once the growth exceeds the
366
+ // padding slack the placeholder no longer lines up with the original
367
+ // region — matchPlaceholder then rejects it and the raw placeholder
368
+ // leaks into the AST (ember-tooling/ember-eslint-parser#230). The
369
+ // content is discarded when the Glimmer AST is spliced in, so only
370
+ // its length and line structure matter.
364
371
  const content = source
365
372
  .slice(pr.contentRange.startUtf16Codepoint, pr.contentRange.endUtf16Codepoint)
366
- .replace(/`/g, "\\`")
367
- .replace(/\$/g, "\\$");
373
+ .replace(/[`$]/g, " ");
368
374
 
369
375
  if (pr.type === "class-member") {
370
376
  const spaces = tplLength - content.length - 10; // "static{`" + "`}" = 10