Skip to content

Commit 5177144

Browse files
authored
chore: remove parser.template_untrimmed (#16511)
1 parent 9945205 commit 5177144

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

.changeset/shiny-berries-call.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
chore: remove `parser.template_untrimmed`

packages/svelte/src/compiler/phases/1-parse/index.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,6 @@ export class Parser {
2323
*/
2424
template;
2525

26-
/**
27-
* @readonly
28-
* @type {string}
29-
*/
30-
template_untrimmed;
31-
3226
/**
3327
* Whether or not we're in loose parsing mode, in which
3428
* case we try to continue parsing as much as possible
@@ -67,7 +61,6 @@ export class Parser {
6761
}
6862

6963
this.loose = loose;
70-
this.template_untrimmed = template;
7164
this.template = template.trimEnd();
7265

7366
let match_lang;

packages/svelte/src/compiler/phases/1-parse/state/element.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,6 @@ export default function element(parser) {
370370
// ... or we're followed by whitespace, for example near the end of the template,
371371
// which we want to take in so that language tools has more room to work with
372372
parser.allow_whitespace();
373-
if (parser.index === parser.template.length) {
374-
while (
375-
parser.index < parser.template_untrimmed.length &&
376-
regex_whitespace.test(parser.template_untrimmed[parser.index])
377-
) {
378-
parser.index++;
379-
}
380-
}
381373
}
382374
}
383375
}

0 commit comments

Comments
 (0)