@@ -4328,7 +4328,7 @@ module ts {
43284328 case SyntaxKind . ArrayLiteral :
43294329 case SyntaxKind . ObjectLiteral :
43304330 case SyntaxKind . PropertyAccess :
4331- case SyntaxKind . IndexedAccess :
4331+ case SyntaxKind . ElementAccessExpression :
43324332 case SyntaxKind . CallExpression :
43334333 case SyntaxKind . NewExpression :
43344334 case SyntaxKind . TypeAssertion :
@@ -4625,7 +4625,7 @@ module ts {
46254625 }
46264626
46274627 function checkSuperExpression ( node : Node ) : Type {
4628- var isCallExpression = node . parent . kind === SyntaxKind . CallExpression && ( < CallExpression > node . parent ) . func === node ;
4628+ var isCallExpression = node . parent . kind === SyntaxKind . CallExpression && ( < CallExpression > node . parent ) . expression === node ;
46294629 var enclosingClass = < ClassDeclaration > getAncestor ( node , SyntaxKind . ClassDeclaration ) ;
46304630 var baseClass : Type ;
46314631 if ( enclosingClass && enclosingClass . baseType ) {
@@ -5208,15 +5208,15 @@ module ts {
52085208 return true ;
52095209 }
52105210
5211- function checkIndexedAccess ( node : IndexedAccess ) : Type {
5211+ function checkIndexedAccess ( node : ElementAccessExpression ) : Type {
52125212 // Obtain base constraint such that we can bail out if the constraint is an unknown type
5213- var objectType = getApparentType ( checkExpression ( node . object ) ) ;
5214- var indexType = checkExpression ( node . index ) ;
5213+ var objectType = getApparentType ( checkExpression ( node . expression ) ) ;
5214+ var indexType = checkExpression ( node . argumentExpression ) ;
52155215
52165216 if ( objectType === unknownType ) return unknownType ;
52175217
5218- if ( isConstEnumObjectType ( objectType ) && node . index . kind !== SyntaxKind . StringLiteral ) {
5219- error ( node . index , Diagnostics . Index_expression_arguments_in_const_enums_must_be_of_type_string ) ;
5218+ if ( isConstEnumObjectType ( objectType ) && node . argumentExpression . kind !== SyntaxKind . StringLiteral ) {
5219+ error ( node . argumentExpression , Diagnostics . Index_expression_arguments_in_const_enums_must_be_of_type_string ) ;
52205220 }
52215221
52225222 // TypeScript 1.0 spec (April 2014): 4.10 Property Access
@@ -5229,8 +5229,8 @@ module ts {
52295229 // - Otherwise, if IndexExpr is of type Any, the String or Number primitive type, or an enum type, the property access is of type Any.
52305230
52315231 // See if we can index as a property.
5232- if ( node . index . kind === SyntaxKind . StringLiteral || node . index . kind === SyntaxKind . NumericLiteral ) {
5233- var name = ( < LiteralExpression > node . index ) . text ;
5232+ if ( node . argumentExpression . kind === SyntaxKind . StringLiteral || node . argumentExpression . kind === SyntaxKind . NumericLiteral ) {
5233+ var name = ( < LiteralExpression > node . argumentExpression ) . text ;
52345234 var prop = getPropertyOfType ( objectType , name ) ;
52355235 if ( prop ) {
52365236 getNodeLinks ( node ) . resolvedSymbol = prop ;
@@ -5629,7 +5629,7 @@ module ts {
56295629 Diagnostics . The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly ,
56305630 typeToString ( failedTypeParameter ) ) ;
56315631
5632- reportNoCommonSupertypeError ( inferenceCandidates , ( < CallExpression > node ) . func || ( < TaggedTemplateExpression > node ) . tag , diagnosticChainHead ) ;
5632+ reportNoCommonSupertypeError ( inferenceCandidates , ( < CallExpression > node ) . expression || ( < TaggedTemplateExpression > node ) . tag , diagnosticChainHead ) ;
56335633 }
56345634 }
56355635 else {
@@ -5759,15 +5759,15 @@ module ts {
57595759 }
57605760
57615761 function resolveCallExpression ( node : CallExpression , candidatesOutArray : Signature [ ] ) : Signature {
5762- if ( node . func . kind === SyntaxKind . SuperKeyword ) {
5763- var superType = checkSuperExpression ( node . func ) ;
5762+ if ( node . expression . kind === SyntaxKind . SuperKeyword ) {
5763+ var superType = checkSuperExpression ( node . expression ) ;
57645764 if ( superType !== unknownType ) {
57655765 return resolveCall ( node , getSignaturesOfType ( superType , SignatureKind . Construct ) , candidatesOutArray ) ;
57665766 }
57675767 return resolveUntypedCall ( node ) ;
57685768 }
57695769
5770- var funcType = checkExpression ( node . func ) ;
5770+ var funcType = checkExpression ( node . expression ) ;
57715771 var apparentType = getApparentType ( funcType ) ;
57725772
57735773 if ( apparentType === unknownType ) {
@@ -5811,7 +5811,7 @@ module ts {
58115811 }
58125812
58135813 function resolveNewExpression ( node : NewExpression , candidatesOutArray : Signature [ ] ) : Signature {
5814- var expressionType = checkExpression ( node . func ) ;
5814+ var expressionType = checkExpression ( node . expression ) ;
58155815 // TS 1.0 spec: 4.11
58165816 // If ConstructExpr is of type Any, Args can be any argument
58175817 // list and the result of the operation is of type Any.
@@ -5911,7 +5911,7 @@ module ts {
59115911
59125912 function checkCallExpression ( node : CallExpression ) : Type {
59135913 var signature = getResolvedSignature ( node ) ;
5914- if ( node . func . kind === SyntaxKind . SuperKeyword ) {
5914+ if ( node . expression . kind === SyntaxKind . SuperKeyword ) {
59155915 return voidType ;
59165916 }
59175917 if ( node . kind === SyntaxKind . NewExpression ) {
@@ -5936,7 +5936,7 @@ module ts {
59365936 }
59375937
59385938 function checkTypeAssertion ( node : TypeAssertion ) : Type {
5939- var exprType = checkExpression ( node . operand ) ;
5939+ var exprType = checkExpression ( node . expression ) ;
59405940 var targetType = getTypeFromTypeNode ( node . type ) ;
59415941 if ( fullTypeCheck && targetType !== unknownType ) {
59425942 var widenedType = getWidenedType ( exprType , /*supressNoImplicitAnyErrors*/ true ) ;
@@ -6171,7 +6171,7 @@ module ts {
61716171 // A property access expression is always classified as a reference.
61726172 // NOTE (not in spec): assignment to enum members should not be allowed
61736173 return ! symbol || symbol === unknownSymbol || ( symbol . flags & ~ SymbolFlags . EnumMember ) !== 0 ;
6174- case SyntaxKind . IndexedAccess :
6174+ case SyntaxKind . ElementAccessExpression :
61756175 // old compiler doesn't check indexed assess
61766176 return true ;
61776177 case SyntaxKind . ParenExpression :
@@ -6187,9 +6187,9 @@ module ts {
61876187 case SyntaxKind . PropertyAccess :
61886188 var symbol = findSymbol ( n ) ;
61896189 return symbol && ( symbol . flags & SymbolFlags . Variable ) !== 0 && ( getDeclarationFlagsFromSymbol ( symbol ) & NodeFlags . Const ) !== 0 ;
6190- case SyntaxKind . IndexedAccess :
6191- var index = ( < IndexedAccess > n ) . index ;
6192- var symbol = findSymbol ( ( < IndexedAccess > n ) . object ) ;
6190+ case SyntaxKind . ElementAccessExpression :
6191+ var index = ( < ElementAccessExpression > n ) . argumentExpression ;
6192+ var symbol = findSymbol ( ( < ElementAccessExpression > n ) . expression ) ;
61936193 if ( symbol && index . kind === SyntaxKind . StringLiteral ) {
61946194 var name = ( < LiteralExpression > index ) . text ;
61956195 var prop = getPropertyOfType ( getTypeOfSymbol ( symbol ) , name ) ;
@@ -6525,7 +6525,7 @@ module ts {
65256525 // - target in rhs of import statement
65266526 var ok =
65276527 ( node . parent . kind === SyntaxKind . PropertyAccess && ( < PropertyAccess > node . parent ) . left === node ) ||
6528- ( node . parent . kind === SyntaxKind . IndexedAccess && ( < IndexedAccess > node . parent ) . object === node ) ||
6528+ ( node . parent . kind === SyntaxKind . ElementAccessExpression && ( < ElementAccessExpression > node . parent ) . expression === node ) ||
65296529 ( ( node . kind === SyntaxKind . Identifier || node . kind === SyntaxKind . QualifiedName ) && isInRightSideOfImportOrExportAssignment ( < EntityName > node ) ) ;
65306530
65316531 if ( ! ok ) {
@@ -6565,8 +6565,8 @@ module ts {
65656565 return checkObjectLiteral ( < ObjectLiteral > node , contextualMapper ) ;
65666566 case SyntaxKind . PropertyAccess :
65676567 return checkPropertyAccess ( < PropertyAccess > node ) ;
6568- case SyntaxKind . IndexedAccess :
6569- return checkIndexedAccess ( < IndexedAccess > node ) ;
6568+ case SyntaxKind . ElementAccessExpression :
6569+ return checkIndexedAccess ( < ElementAccessExpression > node ) ;
65706570 case SyntaxKind . CallExpression :
65716571 case SyntaxKind . NewExpression :
65726572 return checkCallExpression ( < CallExpression > node ) ;
@@ -6763,7 +6763,7 @@ module ts {
67636763 }
67646764
67656765 function isSuperCallExpression ( n : Node ) : boolean {
6766- return n . kind === SyntaxKind . CallExpression && ( < CallExpression > n ) . func . kind === SyntaxKind . SuperKeyword ;
6766+ return n . kind === SyntaxKind . CallExpression && ( < CallExpression > n ) . expression . kind === SyntaxKind . SuperKeyword ;
67676767 }
67686768
67696769 function containsSuperCall ( n : Node ) : boolean {
@@ -8139,7 +8139,7 @@ module ts {
81398139 case SyntaxKind . ParenExpression :
81408140 return enumIsConst ? evalConstant ( ( < ParenExpression > e ) . expression ) : undefined ;
81418141 case SyntaxKind . Identifier :
8142- case SyntaxKind . IndexedAccess :
8142+ case SyntaxKind . ElementAccessExpression :
81438143 case SyntaxKind . PropertyAccess :
81448144 if ( ! enumIsConst ) {
81458145 return undefined ;
@@ -8157,12 +8157,12 @@ module ts {
81578157 propertyName = ( < Identifier > e ) . text ;
81588158 }
81598159 else {
8160- if ( e . kind === SyntaxKind . IndexedAccess ) {
8161- if ( ( < IndexedAccess > e ) . index . kind !== SyntaxKind . StringLiteral ) {
8160+ if ( e . kind === SyntaxKind . ElementAccessExpression ) {
8161+ if ( ( < ElementAccessExpression > e ) . argumentExpression . kind !== SyntaxKind . StringLiteral ) {
81628162 return undefined ;
81638163 }
8164- var enumType = getTypeOfNode ( ( < IndexedAccess > e ) . object ) ;
8165- propertyName = ( < LiteralExpression > ( < IndexedAccess > e ) . index ) . text ;
8164+ var enumType = getTypeOfNode ( ( < ElementAccessExpression > e ) . expression ) ;
8165+ propertyName = ( < LiteralExpression > ( < ElementAccessExpression > e ) . argumentExpression ) . text ;
81668166 }
81678167 else {
81688168 var enumType = getTypeOfNode ( ( < PropertyAccess > e ) . left ) ;
@@ -8491,7 +8491,7 @@ module ts {
84918491 case SyntaxKind . ObjectLiteral :
84928492 case SyntaxKind . PropertyAssignment :
84938493 case SyntaxKind . PropertyAccess :
8494- case SyntaxKind . IndexedAccess :
8494+ case SyntaxKind . ElementAccessExpression :
84958495 case SyntaxKind . CallExpression :
84968496 case SyntaxKind . NewExpression :
84978497 case SyntaxKind . TaggedTemplateExpression :
@@ -8907,8 +8907,8 @@ module ts {
89078907 // Intentional fall-through
89088908 case SyntaxKind . NumericLiteral :
89098909 // index access
8910- if ( node . parent . kind == SyntaxKind . IndexedAccess && ( < IndexedAccess > node . parent ) . index === node ) {
8911- var objectType = checkExpression ( ( < IndexedAccess > node . parent ) . object ) ;
8910+ if ( node . parent . kind == SyntaxKind . ElementAccessExpression && ( < ElementAccessExpression > node . parent ) . argumentExpression === node ) {
8911+ var objectType = checkExpression ( ( < ElementAccessExpression > node . parent ) . expression ) ;
89128912 if ( objectType === unknownType ) return undefined ;
89138913 var apparentType = getApparentType ( objectType ) ;
89148914 if ( apparentType === unknownType ) return undefined ;
@@ -9160,7 +9160,7 @@ module ts {
91609160 return getNodeLinks ( node ) . enumMemberValue ;
91619161 }
91629162
9163- function getConstantValue ( node : PropertyAccess | IndexedAccess ) : number {
9163+ function getConstantValue ( node : PropertyAccess | ElementAccessExpression ) : number {
91649164 var symbol = getNodeLinks ( node ) . resolvedSymbol ;
91659165 if ( symbol && ( symbol . flags & SymbolFlags . EnumMember ) ) {
91669166 var declaration = symbol . valueDeclaration ;
0 commit comments