Skip to content

Conversation

@DanielRosenwasser
Copy link
Member

Fixes #3893.

Copy link
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
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
Contributor

Does this work for parameters?

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

@DanielRosenwasser
Copy link
Member Author

@DanielRosenwasser
Copy link
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
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.

5 participants