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

Rename context parameter to guarantee it doesn't capture any free variables #11

Closed
benjamn opened this issue Oct 5, 2013 · 0 comments
Closed

Comments

@benjamn
Copy link
Collaborator

benjamn commented Oct 5, 2013

The only new variable introduced in the scope of the inner generator function is the context or $ctx parameter, and while it might be acceptable to say "just don't name any variables context or $ctx," it would really be ideal to synthesize the name of the parameter such that we can be completely confident of its freshness.

The great thing about having the context parameter and knowing that it doesn't collide with any other variables is that the generated code can then add arbitrary properties to it without any concern for scope pollution.

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

No branches or pull requests

1 participant