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

Recursive function bindings do not follow the spec #53

Open
tilk opened this issue Feb 6, 2015 · 0 comments
Open

Recursive function bindings do not follow the spec #53

tilk opened this issue Feb 6, 2015 · 0 comments

Comments

@tilk
Copy link

tilk commented Feb 6, 2015

The following program returns 120 in S5, should throw an exception (because the f variable should shadow the recursive binding):

var x = function f (a) { var f; if (a == 0) return 1; else return a * f(a-1) }; x(5)

Reason: ES5 chapter 13 says that a new scope should be introduced for the recursive binding, but S5's desugaring puts the recursive binding directly in the function's scope.

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

1 participant