File tree 1 file changed +15
-4
lines changed
1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -3363,20 +3363,31 @@ namespace ts {
3363
3363
3364
3364
let existingMemberNames : Map < boolean > = { } ;
3365
3365
for ( let m of existingMembers ) {
3366
+ // Ignore omitted expressions for missing members
3366
3367
if ( m . kind !== SyntaxKind . PropertyAssignment &&
3367
3368
m . kind !== SyntaxKind . ShorthandPropertyAssignment &&
3368
3369
m . kind !== SyntaxKind . BindingElement ) {
3369
- // Ignore omitted expressions for missing members
3370
3370
continue ;
3371
3371
}
3372
3372
3373
+ // If this is the current item we are editing right now, do not filter it out
3373
3374
if ( m . getStart ( ) <= position && position <= m . getEnd ( ) ) {
3374
- // If this is the current item we are editing right now, do not filter it out
3375
3375
continue ;
3376
3376
}
3377
3377
3378
- // TODO(jfreeman): Account for computed property name
3379
- existingMemberNames [ ( < Identifier > m . name ) . text ] = true ;
3378
+ let existingName : string ;
3379
+
3380
+ if ( m . kind === SyntaxKind . BindingElement && ( < BindingElement > m ) . propertyName ) {
3381
+ existingName = ( < BindingElement > m ) . propertyName . text ;
3382
+ }
3383
+ else {
3384
+ // TODO(jfreeman): Account for computed property name
3385
+ // NOTE: if one only performs this step when m.name is an identifier,
3386
+ // things like '__proto__' are not filtered out.
3387
+ existingName = ( < Identifier > m . name ) . text ;
3388
+ }
3389
+
3390
+ existingMemberNames [ existingName ] = true ;
3380
3391
}
3381
3392
3382
3393
let filteredMembers : Symbol [ ] = [ ] ;
You can’t perform that action at this time.
0 commit comments