File tree Expand file tree Collapse file tree 3 files changed +7
-30
lines changed
Expand file tree Collapse file tree 3 files changed +7
-30
lines changed Original file line number Diff line number Diff line change @@ -178,12 +178,11 @@ class Transformer extends Source {
178178 }
179179
180180 if ( node instanceof angular . BindingPipe ) {
181- const { exp : expressionNode , name, args : originalArguments } = node ;
181+ const { name } = node ;
182182 const left = this . transform < babel . Expression > (
183- expressionNode ,
183+ node . exp ,
184184 childTransformOptions ,
185185 ) ;
186- const start = getOuterStart ( left ) ;
187186 const leftEnd = getOuterEnd ( left ) ;
188187 const rightStart = this . getCharacterIndex (
189188 / \S / ,
@@ -198,20 +197,16 @@ class Transformer extends Source {
198197 } ,
199198 ancestors ,
200199 ) ;
201- const argumentNodes = originalArguments . map < babel . Expression > ( ( node ) =>
200+ const arguments_ = node . args . map < babel . Expression > ( ( node ) =>
202201 this . transform ( node , childTransformOptions ) ,
203202 ) ;
204203 return this . #create< NGPipeExpression > (
205204 {
206205 type : 'NGPipeExpression' ,
207206 left,
208207 right,
209- arguments : argumentNodes ,
210- start,
211- end : getOuterEnd (
212- // TODO[@fisker ]: End seems not correct, since there should be `()`
213- argumentNodes . length === 0 ? right : argumentNodes . at ( - 1 ) ! ,
214- ) ,
208+ arguments : arguments_ ,
209+ ...node . sourceSpan ,
215210 } ,
216211 ancestors ,
217212 ) ;
Original file line number Diff line number Diff line change 11import type { LocationInformation , RawNGSpan } from './types.ts' ;
22
3- function expandSurroundingSpaces (
4- { start : startIndex , end : endIndex } : RawNGSpan ,
5- text : string ,
6- ) {
7- let start = startIndex ;
8- let end = endIndex ;
9-
10- while ( end !== text . length && / \s / . test ( text [ end ] ) ) {
11- end ++ ;
12- }
13-
14- while ( start !== 0 && / \s / . test ( text [ start - 1 ] ) ) {
15- start -- ;
16- }
17-
18- return { start, end } ;
19- }
20-
213function getCharacterSearchTestFunction ( pattern : RegExp | string ) {
224 if ( typeof pattern === 'string' ) {
235 return ( character : string ) => character === pattern ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ NGPipeExpression {
1313 " comments" : []
1414}
1515> 1 | ( ( ( ( a ) ) | b ))
16- | ^^^^^^^^^^^^^^^^^^
16+ | ^^^^^^^^^^^^^^
1717--------------------------------------------------------------------------------
1818Identifier {
1919 " name" : " a" ,
@@ -82,7 +82,7 @@ NGPipeExpression {
8282 " comments" : []
8383}
8484> 1 | ( ( ( ( a ) ) | b ))
85- | ^^^^^^^^^^^^^^^^^^
85+ | ^^^^^^^^^^^^^^
8686--------------------------------------------------------------------------------
8787Identifier {
8888 " name" : " a" ,
You can’t perform that action at this time.
0 commit comments