@@ -280,9 +280,9 @@ namespace ts {
280280 return node ;
281281 }
282282
283- export function updateMethod ( node : MethodDeclaration , decorators : Decorator [ ] , modifiers : Modifier [ ] , name : PropertyName , typeParameters : TypeParameterDeclaration [ ] , parameters : ParameterDeclaration [ ] , type : TypeNode , body : Block ) {
284- if ( node . decorators !== decorators || node . modifiers !== modifiers || node . name !== name || node . typeParameters !== typeParameters || node . parameters !== parameters || node . type !== type || node . body !== body ) {
285- return updateNode ( createMethod ( decorators , modifiers , node . asteriskToken , name , typeParameters , parameters , type , body , /*location*/ node ) , node ) ;
283+ export function updateMethod ( node : MethodDeclaration , decorators : Decorator [ ] , modifiers : Modifier [ ] , asteriskToken : AsteriskToken , name : PropertyName , typeParameters : TypeParameterDeclaration [ ] , parameters : ParameterDeclaration [ ] , type : TypeNode , body : Block ) {
284+ if ( node . decorators !== decorators || node . modifiers !== modifiers || node . asteriskToken !== asteriskToken || node . name !== name || node . typeParameters !== typeParameters || node . parameters !== parameters || node . type !== type || node . body !== body ) {
285+ return updateNode ( createMethod ( decorators , modifiers , asteriskToken , name , typeParameters , parameters , type , body , /*location*/ node ) , node ) ;
286286 }
287287 return node ;
288288 }
@@ -525,9 +525,9 @@ namespace ts {
525525 return node ;
526526 }
527527
528- export function updateFunctionExpression ( node : FunctionExpression , modifiers : Modifier [ ] , name : Identifier , typeParameters : TypeParameterDeclaration [ ] , parameters : ParameterDeclaration [ ] , type : TypeNode , body : Block ) {
529- if ( node . name !== name || node . modifiers !== modifiers || node . typeParameters !== typeParameters || node . parameters !== parameters || node . type !== type || node . body !== body ) {
530- return updateNode ( createFunctionExpression ( modifiers , node . asteriskToken , name , typeParameters , parameters , type , body , /*location*/ node ) , node ) ;
528+ export function updateFunctionExpression ( node : FunctionExpression , modifiers : Modifier [ ] , asteriskToken : AsteriskToken , name : Identifier , typeParameters : TypeParameterDeclaration [ ] , parameters : ParameterDeclaration [ ] , type : TypeNode , body : Block ) {
529+ if ( node . modifiers !== modifiers || node . asteriskToken !== asteriskToken || node . name !== name || node . typeParameters !== typeParameters || node . parameters !== parameters || node . type !== type || node . body !== body ) {
530+ return updateNode ( createFunctionExpression ( modifiers , asteriskToken , name , typeParameters , parameters , type , body , /*location*/ node ) , node ) ;
531531 }
532532 return node ;
533533 }
@@ -1068,9 +1068,9 @@ namespace ts {
10681068 return node ;
10691069 }
10701070
1071- export function updateFunctionDeclaration ( node : FunctionDeclaration , decorators : Decorator [ ] , modifiers : Modifier [ ] , name : Identifier , typeParameters : TypeParameterDeclaration [ ] , parameters : ParameterDeclaration [ ] , type : TypeNode , body : Block ) {
1072- if ( node . decorators !== decorators || node . modifiers !== modifiers || node . name !== name || node . typeParameters !== typeParameters || node . parameters !== parameters || node . type !== type || node . body !== body ) {
1073- return updateNode ( createFunctionDeclaration ( decorators , modifiers , node . asteriskToken , name , typeParameters , parameters , type , body , /*location*/ node ) , node ) ;
1071+ export function updateFunctionDeclaration ( node : FunctionDeclaration , decorators : Decorator [ ] , modifiers : Modifier [ ] , asteriskToken : AsteriskToken , name : Identifier , typeParameters : TypeParameterDeclaration [ ] , parameters : ParameterDeclaration [ ] , type : TypeNode , body : Block ) {
1072+ if ( node . decorators !== decorators || node . modifiers !== modifiers || node . asteriskToken !== asteriskToken || node . name !== name || node . typeParameters !== typeParameters || node . parameters !== parameters || node . type !== type || node . body !== body ) {
1073+ return updateNode ( createFunctionDeclaration ( decorators , modifiers , asteriskToken , name , typeParameters , parameters , type , body , /*location*/ node ) , node ) ;
10741074 }
10751075 return node ;
10761076 }
@@ -1825,6 +1825,28 @@ namespace ts {
18251825 return node ;
18261826 }
18271827
1828+ export function createForOfBindingStatement ( node : ForInitializer , boundValue : Expression ) : Statement {
1829+ if ( isVariableDeclarationList ( node ) ) {
1830+ const firstDeclaration = firstOrUndefined ( node . declarations ) ;
1831+ const updatedDeclaration = updateVariableDeclaration (
1832+ firstDeclaration ,
1833+ firstDeclaration . name ,
1834+ /*typeNode*/ undefined ,
1835+ boundValue
1836+ ) ;
1837+ return createVariableStatement (
1838+ /*modifiers*/ undefined ,
1839+ updateVariableDeclarationList ( node , [ updatedDeclaration ] ) ,
1840+ /*location*/ node
1841+ ) ;
1842+ }
1843+ else {
1844+ const expression = node ;
1845+ const updatedExpression = createAssignment ( expression , boundValue , /*location*/ expression ) ;
1846+ return createStatement ( updatedExpression , /*location*/ expression ) ;
1847+ }
1848+ }
1849+
18281850 export interface CallBinding {
18291851 target : LeftHandSideExpression ;
18301852 thisArg : Expression ;
0 commit comments