We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f593ec6 + 729077d commit 847dec7Copy full SHA for 847dec7
packages/@glimmer/syntax/lib/v1/legacy-interop.ts
@@ -23,7 +23,14 @@ export class PathExpressionImplV1 implements PathExpression {
23
this.parts = parts;
24
}
25
26
+ // Cache for the head value.
27
+ _head?: PathHead = undefined;
28
+
29
get head(): PathHead {
30
+ if (this._head) {
31
+ return this._head;
32
+ }
33
34
let firstPart: string;
35
36
if (this.this) {
@@ -38,7 +45,7 @@ export class PathExpressionImplV1 implements PathExpression {
38
45
chars: firstPart.length,
39
46
}).loc;
40
47
41
- return b.head(firstPart, firstPartLoc);
48
+ return (this._head = b.head(firstPart, firstPartLoc));
42
49
43
50
44
51
get tail(): string[] {
0 commit comments