@@ -112,7 +112,10 @@ namespace ts {
112112 Debug . assertNode ( target , createAssignmentCallback ? isIdentifier : isExpression ) ;
113113 const expression = createAssignmentCallback
114114 ? 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+ ) ;
116119 expression . original = original ;
117120 emitExpression ( expression ) ;
118121 }
@@ -174,9 +177,10 @@ namespace ts {
174177 const variable = createVariableDeclaration (
175178 name ,
176179 /*type*/ undefined ,
177- pendingExpressions ? inlineExpressions ( append ( pendingExpressions , value ) ) : value ,
178- location ) ;
180+ pendingExpressions ? inlineExpressions ( append ( pendingExpressions , value ) ) : value
181+ ) ;
179182 variable . original = original ;
183+ setTextRange ( variable , location ) ;
180184 if ( isIdentifier ( name ) ) {
181185 setEmitFlags ( variable , EmitFlags . NoNestedSourceMaps ) ;
182186 }
@@ -416,7 +420,7 @@ namespace ts {
416420 const temp = createTempVariable ( /*recordTempVariable*/ undefined ) ;
417421 if ( flattenContext . hoistTempVariables ) {
418422 flattenContext . context . hoistVariableDeclaration ( temp ) ;
419- flattenContext . emitExpression ( createAssignment ( temp , value , location ) ) ;
423+ flattenContext . emitExpression ( setTextRange ( createAssignment ( temp , value ) , location ) ) ;
420424 }
421425 else {
422426 flattenContext . emitBindingOrAssignment ( temp , value , location , /*original*/ undefined ) ;
@@ -492,6 +496,15 @@ namespace ts {
492496 }
493497 }
494498 }
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+ ] ) ;
496509 }
497510}
0 commit comments