Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Nov 15, 2018

Previously the check was only done if parent.initializer existed, which meant it worked for variable declarations but not for parameters.

@ghost ghost requested a review from sheetalkamat November 16, 2018 00:04
@ghost ghost merged commit e0dca0b into master Nov 16, 2018
@ghost ghost deleted the destructureParameterPrivateProperty branch November 16, 2018 20:47
@princed
Copy link

princed commented Nov 17, 2018

Don't you want to add a test for this one?

@ghost
Copy link
Author

ghost commented Nov 17, 2018

See the bottom of privateProtectedMembersAreNotAccessibleDestructuring.ts.

@princed
Copy link

princed commented Nov 17, 2018

Oh, I'm sorry, I was going to comment in #26760, so there would be nested destructuring context.

I thought we could add something like this to privateProtectedMembersAreNotAccessibleDestructuring.ts:

let nested = { k };
let {k: {priv: an, prot: bn, privateMethod: pmn}} = nested; // error

What do you think?

@ghost
Copy link
Author

ghost commented Nov 17, 2018

PRs accepted. 👍

@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 21, 2025
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants