Repository navigation
Fix destructuring assignment when assignment target is RHS - #21219
Conversation
Wesley Wigham (weswigham)
left a comment
There was a problem hiding this comment.
Needs the typescriptserver.d.ts api update included, but otherwise seems good.
|
AFAICT this PR only handles identifiers. This is an issue for property access as well. ({foo, bar} = foo.bar);
// or
({foo: foo.bar, bar} = foo.bar);I don't know if this is really necessary or just theoretically possible but never actually used in real world code. |
|
Klaus Meinhardt (@ajafff) we already handle For now I'd consider this "good enough". The only other change we could make would be to create temporaries for every result before we begin assignments, however this can generate a lot of temporaries. |
This fixes destructuring assignments and variable destructuring when the assignment target is the same identifier as the RHS.
Fixes #19020