Skip to content

Commit e7ba5c6

Browse files
committed
Workaround
1 parent a957af4 commit e7ba5c6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/transform-node.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,13 +290,19 @@ class Transformer extends Source {
290290
node instanceof angular.KeyedRead ||
291291
node instanceof angular.SafeKeyedRead
292292
) {
293+
// TODO: Use `node.sourceSpan.end` directly
294+
// https://github.com/angular/angular/issues/62617
295+
const end =
296+
this.text.charAt(node.sourceSpan.end - 1) === '='
297+
? this.getCharacterLastIndex(/\S/, node.sourceSpan.end - 2) + 1
298+
: node.sourceSpan.end;
293299
return this.#transformReceiverAndName(
294300
node.receiver,
295301
this.#transform<babel.Expression>(node.key),
296302
{
297303
computed: true,
298304
optional: node instanceof angular.SafeKeyedRead,
299-
end: node.sourceSpan.end, // ]
305+
end: end, // ]
300306
hasParentParens: isInParentParens,
301307
},
302308
);

0 commit comments

Comments
 (0)