@@ -109,12 +109,12 @@ namespace ts {
109109 export function createLiteral ( value : string | number | boolean , location ?: TextRange ) : PrimaryExpression ;
110110 export function createLiteral ( value : string | number | boolean | StringLiteral | Identifier , location ?: TextRange ) : PrimaryExpression {
111111 if ( typeof value === "number" ) {
112- const node = < LiteralExpression > createNode ( SyntaxKind . NumericLiteral , location , /*flags*/ undefined ) ;
112+ const node = < NumericLiteral > createNode ( SyntaxKind . NumericLiteral , location , /*flags*/ undefined ) ;
113113 node . text = value . toString ( ) ;
114114 return node ;
115115 }
116116 else if ( typeof value === "boolean" ) {
117- return < PrimaryExpression > createNode ( value ? SyntaxKind . TrueKeyword : SyntaxKind . FalseKeyword , location , /*flags*/ undefined ) ;
117+ return < BooleanLiteral > createNode ( value ? SyntaxKind . TrueKeyword : SyntaxKind . FalseKeyword , location , /*flags*/ undefined ) ;
118118 }
119119 else if ( typeof value === "string" ) {
120120 const node = < StringLiteral > createNode ( SyntaxKind . StringLiteral , location , /*flags*/ undefined ) ;
@@ -226,20 +226,7 @@ namespace ts {
226226
227227 // Signature elements
228228
229- export function createParameter ( name : string | Identifier | BindingPattern , initializer ?: Expression , location ?: TextRange ) {
230- return createParameterDeclaration (
231- /*decorators*/ undefined ,
232- /*modifiers*/ undefined ,
233- /*dotDotDotToken*/ undefined ,
234- name ,
235- /*questionToken*/ undefined ,
236- /*type*/ undefined ,
237- initializer ,
238- location
239- ) ;
240- }
241-
242- export function createParameterDeclaration ( decorators : Decorator [ ] , modifiers : Modifier [ ] , dotDotDotToken : DotDotDotToken , name : string | Identifier | BindingPattern , questionToken : QuestionToken , type : TypeNode , initializer : Expression , location ?: TextRange , flags ?: NodeFlags ) {
229+ export function createParameter ( decorators : Decorator [ ] , modifiers : Modifier [ ] , dotDotDotToken : DotDotDotToken , name : string | Identifier | BindingPattern , questionToken ?: QuestionToken , type ?: TypeNode , initializer ?: Expression , location ?: TextRange , flags ?: NodeFlags ) {
243230 const node = < ParameterDeclaration > createNode ( SyntaxKind . Parameter , location , flags ) ;
244231 node . decorators = decorators ? createNodeArray ( decorators ) : undefined ;
245232 node . modifiers = modifiers ? createNodeArray ( modifiers ) : undefined ;
@@ -251,9 +238,9 @@ namespace ts {
251238 return node ;
252239 }
253240
254- export function updateParameterDeclaration ( node : ParameterDeclaration , decorators : Decorator [ ] , modifiers : Modifier [ ] , name : BindingName , type : TypeNode , initializer : Expression ) {
241+ export function updateParameter ( node : ParameterDeclaration , decorators : Decorator [ ] , modifiers : Modifier [ ] , name : BindingName , type : TypeNode , initializer : Expression ) {
255242 if ( node . decorators !== decorators || node . modifiers !== modifiers || node . name !== name || node . type !== type || node . initializer !== initializer ) {
256- return updateNode ( createParameterDeclaration ( decorators , modifiers , node . dotDotDotToken , name , node . questionToken , type , initializer , /*location*/ node , /*flags*/ node . flags ) , node ) ;
243+ return updateNode ( createParameter ( decorators , modifiers , node . dotDotDotToken , name , node . questionToken , type , initializer , /*location*/ node , /*flags*/ node . flags ) , node ) ;
257244 }
258245
259246 return node ;
@@ -1557,18 +1544,6 @@ namespace ts {
15571544 }
15581545 }
15591546
1560- export function createRestParameter ( name : string | Identifier ) {
1561- return createParameterDeclaration (
1562- /*decorators*/ undefined ,
1563- /*modifiers*/ undefined ,
1564- createToken ( SyntaxKind . DotDotDotToken ) ,
1565- name ,
1566- /*questionToken*/ undefined ,
1567- /*type*/ undefined ,
1568- /*initializer*/ undefined
1569- ) ;
1570- }
1571-
15721547 export function createFunctionCall ( func : Expression , thisArg : Expression , argumentsList : Expression [ ] , location ?: TextRange ) {
15731548 return createCall (
15741549 createPropertyAccess ( func , "call" ) ,
@@ -1781,13 +1756,10 @@ namespace ts {
17811756 return createArrowFunction (
17821757 /*modifiers*/ undefined ,
17831758 /*typeParameters*/ undefined ,
1784- [ createParameter ( "name" ) ] ,
1759+ [ createParameter ( /*decorators*/ undefined , /*modifiers*/ undefined , /*dotDotDotToken*/ undefined , "name" ) ] ,
17851760 /*type*/ undefined ,
1786- /*equalsGreaterThanToken*/ undefined ,
1787- createElementAccess (
1788- target ,
1789- createIdentifier ( "name" )
1790- )
1761+ createToken ( SyntaxKind . EqualsGreaterThanToken ) ,
1762+ createElementAccess ( target , createIdentifier ( "name" ) )
17911763 ) ;
17921764 }
17931765
@@ -1797,11 +1769,11 @@ namespace ts {
17971769 /*modifiers*/ undefined ,
17981770 /*typeParameters*/ undefined ,
17991771 [
1800- createParameter ( "name" ) ,
1801- createParameter ( "value" )
1772+ createParameter ( /*decorators*/ undefined , /*modifiers*/ undefined , /*dotDotDotToken*/ undefined , "name" ) ,
1773+ createParameter ( /*decorators*/ undefined , /*modifiers*/ undefined , /*dotDotDotToken*/ undefined , "value" )
18021774 ] ,
18031775 /*type*/ undefined ,
1804- /*equalsGreaterThanToken*/ undefined ,
1776+ createToken ( SyntaxKind . EqualsGreaterThanToken ) ,
18051777 createAssignment (
18061778 createElementAccess (
18071779 target ,
@@ -1853,7 +1825,7 @@ namespace ts {
18531825 /*decorators*/ undefined ,
18541826 /*modifiers*/ undefined ,
18551827 "value" ,
1856- [ createParameter ( "v" ) ] ,
1828+ [ createParameter ( /*decorators*/ undefined , /*modifiers*/ undefined , /*dotDotDotToken*/ undefined , "v" ) ] ,
18571829 createBlock ( [
18581830 createStatement (
18591831 createCall (
@@ -1873,9 +1845,9 @@ namespace ts {
18731845 createArrowFunction (
18741846 /*modifiers*/ undefined ,
18751847 /*typeParameters*/ undefined ,
1876- [ createParameter ( "name" ) ] ,
1848+ [ createParameter ( /*decorators*/ undefined , /*modifiers*/ undefined , /*dotDotDotToken*/ undefined , "name" ) ] ,
18771849 /*type*/ undefined ,
1878- /*equalsGreaterThanToken*/ undefined ,
1850+ createToken ( SyntaxKind . EqualsGreaterThanToken ) ,
18791851 createLogicalOr (
18801852 createElementAccess (
18811853 createIdentifier ( "cache" ) ,
@@ -1915,8 +1887,8 @@ namespace ts {
19151887 /*name*/ undefined ,
19161888 /*typeParameters*/ undefined ,
19171889 [
1918- createParameter ( "geti" ) ,
1919- createParameter ( "seti" )
1890+ createParameter ( /*decorators*/ undefined , /*modifiers*/ undefined , /*dotDotDotToken*/ undefined , "geti" ) ,
1891+ createParameter ( /*decorators*/ undefined , /*modifiers*/ undefined , /*dotDotDotToken*/ undefined , "seti" )
19201892 ] ,
19211893 /*type*/ undefined ,
19221894 createBlock ( [
@@ -2246,7 +2218,7 @@ namespace ts {
22462218
22472219 /**
22482220 * Ensures "use strict" directive is added
2249- *
2221+ *
22502222 * @param node source file
22512223 */
22522224 export function ensureUseStrict ( node : SourceFile ) : SourceFile {
0 commit comments