Skip to content
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

Another let issue #2389

Closed
mnowik opened this issue Sep 16, 2015 · 3 comments
Closed

Another let issue #2389

mnowik opened this issue Sep 16, 2015 · 3 comments
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue

Comments

@mnowik
Copy link

mnowik commented Sep 16, 2015

I have an issue using let.

Here is my code:

if (a === b ) {
  let defaultReturnAddress = {};
  let returnAddress = _this.get('currentUser.address');
  ...
}
if (defaultReturnAddress) {...}

Here is the translation using ember-cli-babel@5.1.5

if (a === b ) {
  var _defaultReturnAddress = {};
  var returnAddress = _this.get('currentUser.address');
  ...
}
if (defaultReturnAddress) {...}

It seems to be linked to this error on babel #166.
This error was closed a while ago. However, it seems to be a Babel issue.

@sebmck
Copy link
Contributor

sebmck commented Sep 16, 2015

What's the issue here? let is block scoped, it seems to be having correctly. What output are you expecting?

@mnowik
Copy link
Author

mnowik commented Sep 16, 2015

The if block is a scope by itself ?
I would have except var defaultReturnAddress

@sebmck
Copy link
Contributor

sebmck commented Sep 16, 2015

let is called a block scoped variable so yeah let is bound to it. Closing as this isn't an issue and is expected behaviour.

@sebmck sebmck closed this as completed Sep 16, 2015
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 12, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue
Projects
None yet
Development

No branches or pull requests

2 participants