-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Runtime defaults to creating a global variable #166
Comments
This would also be a good supplement to the core aliasing (and babel/babel#446) behaviour of 6to5. It'd allow library authors to use generators with 6to5 and have the regenerator runtime imported into the local variable scope so it wouldn't leak. |
I think this might be a potential answer to my recent question: #165 (comment) |
Are you defining a local variable called |
@benjamn Ideally it'd be great to be able to go |
@benjamn for my case, I wouldn't need that be configurable, so that could be a separate issue. I'm using this configuration with
|
I think it should be made clear somewhere that the module still has to be assigned to the variable |
That's true, but the failure mode is that generated code will make undefined reference to |
That is true. But having to run into the issue in the first place to find out the name to use (which requires inspecting the generated code) can be discouraging. Personally I would be annoyed if I had to find out that way. Either way, I think it would be worth extending the readme with an example that shows how to include the runtime "manually" (not via |
It's quite unfortunate that the runtime is not easy to package up as self-contained module. It seems to me that if the
exports
variable is available, then there should be no need to create the global variable.I'm creating a self-contained library with generators, and it would be great to not have to manually delete this variable.
The text was updated successfully, but these errors were encountered: