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

Small inaccuracy in the Arrow functions article's example #24

Open
UltCombo opened this issue Nov 7, 2014 · 4 comments
Open

Small inaccuracy in the Arrow functions article's example #24

UltCombo opened this issue Nov 7, 2014 · 4 comments

Comments

@UltCombo
Copy link
Member

UltCombo commented Nov 7, 2014

See d71ae1e#commitcomment-8237436

We should either replace BodyElement with WindowObject or replace the whole example with a more useful one.

//cc @felipenmoura

@UltCombo
Copy link
Member Author

UltCombo commented Mar 2, 2015

Another issue has arisen in this Twitter discussion -- arrow functions' scopes don't have an arguments binding, it must resolve to a binding in an outer scope. (reference: see note in 14.2.15)

@adamdicarlo
Copy link

Maybe an example like this?

// prints ['lexical scope argument']
(function () {
  let f = () => console.log(arguments);
  f('hi');
}('lexical scope argument'));

And some change to the text would be nice, like

arguments is lexically bound, like this

Although I also like your describing it as "arrow functions' scopes don't have an arguments binding."

@UltCombo
Copy link
Member Author

UltCombo commented Mar 2, 2015

Lexically bound is ok, in my opinion. Feel free to send a PR. =]

@felipenmoura
Copy link
Contributor

Good, I like both fixes(the text and the example) :)

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