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.
- package/package.json +1 -1
- package/src/parse.js +8 -2
package/package.json
CHANGED
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(
|
|
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
|