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

let例子解析错误(勘误) #75

Closed
meilihao opened this issue Aug 17, 2015 · 3 comments
Closed

let例子解析错误(勘误) #75

meilihao opened this issue Aug 17, 2015 · 3 comments

Comments

@meilihao
Copy link

http://es6.ruanyifeng.com/#docs/let,不存在变量提升:

let foo = 'outer';

function bar(func = x => foo) {
  let foo = 'inner';
  console.log(func()); // outer
}

bar();

上面的例子中, console.log()应该输出"inner"而不是"outer".

@hax
Copy link

hax commented Aug 17, 2015

traceur输出的是inner,babel输出的是outer

@meilihao
Copy link
Author

FF 40输出的是inner.

@hax
Copy link

hax commented Aug 17, 2015

看了一下,基本确认是 FF 的 bug。所以原文是正确的。

https://bugzilla.mozilla.org/show_bug.cgi?id=1022967
babel/babel#710

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants