Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Fix emitted code for variable statement with no bound variables#4657

Merged
DanielRosenwasser merged 10 commits into
release-1.6microsoft/TypeScript:release-1.6from
emptyVariableDeclarationBindingPatternmicrosoft/TypeScript:emptyVariableDeclarationBindingPatternCopy head branch name to clipboard
Sep 9, 2015
Merged

Fix emitted code for variable statement with no bound variables#4657
DanielRosenwasser merged 10 commits into
release-1.6microsoft/TypeScript:release-1.6from
emptyVariableDeclarationBindingPatternmicrosoft/TypeScript:emptyVariableDeclarationBindingPatternCopy head branch name to clipboard

Conversation

@DanielRosenwasser

Copy link
Copy Markdown
Member

Fixes #3893.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

can you also add a test for assignments,

var a: any;

({} = a);
([] = a);

({}) => { };
([]) => { };

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@JsonFreeman

Copy link
Copy Markdown
Contributor

Does this work for parameters?

function f({} = {}) { }
function g([] = []) { }

@DanielRosenwasser

Copy link
Copy Markdown
Member Author

@DanielRosenwasser

Copy link
Copy Markdown
Member Author

Actually @JsonFreeman, since the issue was when an identifier appeared in the initializer, that's what we should be testing. I'll amend my tests.

@DanielRosenwasser

Copy link
Copy Markdown
Member Author

Done. I've added cases in

  • tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES5.ts
  • tests/cases/conformance/es6/destructuring/emptyVariableDeclarationBindingPatterns01_ES6.ts

DanielRosenwasser added a commit that referenced this pull request Sep 9, 2015
…ngPattern

Fix emitted code for variable statement with no bound variables
@DanielRosenwasser DanielRosenwasser merged commit 96a8158 into release-1.6 Sep 9, 2015
@DanielRosenwasser DanielRosenwasser deleted the emptyVariableDeclarationBindingPattern branch September 9, 2015 23:47
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 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.

4 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.