File tree 2 files changed +14
-1
lines changed
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -605,6 +605,10 @@ class Transformer extends Source {
605
605
) ;
606
606
}
607
607
608
+ if ( node instanceof angular . ParenthesizedExpression ) {
609
+ return this . #transformNode( node . expression ) ;
610
+ }
611
+
608
612
/* c8 ignore next */
609
613
throw new Error ( `Unexpected node type '${ node . constructor . name } '` ) ;
610
614
}
@@ -636,7 +640,8 @@ type SupportedNodes =
636
640
| angular . TypeofExpression
637
641
| angular . VoidExpression
638
642
| angular . TemplateLiteral // Including `TemplateLiteralElement`
639
- | angular . TaggedTemplateLiteral ;
643
+ | angular . TaggedTemplateLiteral
644
+ | angular . ParenthesizedExpression ;
640
645
function transform ( node : SupportedNodes , text : string ) : NGNode {
641
646
return new Transformer ( node , text ) . node ;
642
647
}
Original file line number Diff line number Diff line change @@ -169,9 +169,17 @@ const KNOWN_AST_TYPES = [
169
169
'SafePropertyRead' ,
170
170
'ThisReceiver' ,
171
171
'Interpolation' ,
172
+ 'VoidExpression' ,
173
+ 'TemplateLiteral' ,
174
+ 'TaggedTemplateLiteral' ,
175
+ 'ParenthesizedExpression' ,
172
176
] as const ;
173
177
174
178
export function getAngularNodeType ( node : angular . AST ) {
179
+ if ( node instanceof angular . ParenthesizedExpression ) {
180
+ return getAngularNodeType ( node . expression ) ;
181
+ }
182
+
175
183
return (
176
184
KNOWN_AST_TYPES . find ( ( type ) => node instanceof angular [ type ] ) ??
177
185
node . constructor . name
You can’t perform that action at this time.
0 commit comments