@@ -112,7 +112,10 @@ namespace ts {
112
112
Debug . assertNode ( target , createAssignmentCallback ? isIdentifier : isExpression ) ;
113
113
const expression = createAssignmentCallback
114
114
? createAssignmentCallback ( < Identifier > target , value , location )
115
- : createAssignment ( visitNode ( < Expression > target , visitor , isExpression ) , value , location ) ;
115
+ : setTextRange (
116
+ createAssignment ( visitNode ( < Expression > target , visitor , isExpression ) , value ) ,
117
+ location
118
+ ) ;
116
119
expression . original = original ;
117
120
emitExpression ( expression ) ;
118
121
}
@@ -174,9 +177,10 @@ namespace ts {
174
177
const variable = createVariableDeclaration (
175
178
name ,
176
179
/*type*/ undefined ,
177
- pendingExpressions ? inlineExpressions ( append ( pendingExpressions , value ) ) : value ,
178
- location ) ;
180
+ pendingExpressions ? inlineExpressions ( append ( pendingExpressions , value ) ) : value
181
+ ) ;
179
182
variable . original = original ;
183
+ setTextRange ( variable , location ) ;
180
184
if ( isIdentifier ( name ) ) {
181
185
setEmitFlags ( variable , EmitFlags . NoNestedSourceMaps ) ;
182
186
}
@@ -416,7 +420,7 @@ namespace ts {
416
420
const temp = createTempVariable ( /*recordTempVariable*/ undefined ) ;
417
421
if ( flattenContext . hoistTempVariables ) {
418
422
flattenContext . context . hoistVariableDeclaration ( temp ) ;
419
- flattenContext . emitExpression ( createAssignment ( temp , value , location ) ) ;
423
+ flattenContext . emitExpression ( setTextRange ( createAssignment ( temp , value ) , location ) ) ;
420
424
}
421
425
else {
422
426
flattenContext . emitBindingOrAssignment ( temp , value , location , /*original*/ undefined ) ;
@@ -492,6 +496,15 @@ namespace ts {
492
496
}
493
497
}
494
498
}
495
- return createCall ( getHelperName ( "__rest" ) , undefined , [ value , createArrayLiteral ( propertyNames , location ) ] ) ;
499
+ return createCall (
500
+ getHelperName ( "__rest" ) ,
501
+ undefined ,
502
+ [
503
+ value ,
504
+ setTextRange (
505
+ createArrayLiteral ( propertyNames ) ,
506
+ location
507
+ )
508
+ ] ) ;
496
509
}
497
510
}
0 commit comments