Skip to content

Allow destructuring in ambient #2429

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Mar 30, 2015
Merged

Allow destructuring in ambient #2429

merged 11 commits into from
Mar 30, 2015

Conversation

yuit
Copy link
Contributor

@yuit yuit commented Mar 19, 2015

Address #2421

@DanielRosenwasser
Copy link
Member

There are no tests here for default initializers.

Consider a few like:

function f({x = 10, y: [a,b,c,d] = [1,2,3,4]} = { x: 10, y: [2,4,6,8] }) {
    return x + y[4];
}

@JsonFreeman
Copy link
Contributor

Yes, make sure that default initializers are disallowed. Also make sure that rest elements are allowed.

@JsonFreeman
Copy link
Contributor

👍

@JsonFreeman
Copy link
Contributor

🎉

// If it is a nested binding pattern, we will recursively descend into each element and emit each one separately.
// In the case of rest element, we will omit rest element.
// Example:
// original: function foo([a, [[b]], c] = [1,[["string"]], 3]) {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great comments, thanks!

yuit added a commit that referenced this pull request Mar 30, 2015
@yuit yuit merged commit 5330db6 into master Mar 30, 2015
@yuit yuit deleted the allowDestructuringInAmbient branch March 30, 2015 23:58
@microsoft microsoft locked and limited conversation to collaborators Jun 18, 2018
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.

5 participants