Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Allow the runtime to be required as a module, and make it strict-mode-compliant.#167

Merged
benjamn merged 1 commit intomasterfrom
opt-into-strict-mode
Jan 14, 2015
Merged

Allow the runtime to be required as a module, and make it strict-mode-compliant.#167
benjamn merged 1 commit intomasterfrom
opt-into-strict-mode

Conversation

@benjamn
Copy link
Copy Markdown
Contributor

@benjamn benjamn commented Jan 14, 2015

@sebmck @appden does this work for you?

I'm a little worried that this will be a breaking change for users who expect regeneratorRuntime to be defined globally for them. What if we kept defining it globally in https://github.com/facebook/regenerator/blob/master/runtime.js, but provided another file that you could require as a proper module instead?

Fixes #165.
Fixes #166.

@sebmck
Copy link
Copy Markdown
Contributor

sebmck commented Jan 14, 2015

What if we kept defining it globally in https://github.com/facebook/regenerator/blob/master/runtime.js, but provided another file that you could require as a proper module instead?

Sounds good to me.

@appden
Copy link
Copy Markdown

appden commented Jan 14, 2015

Great, I'm excited by this change! I posted a comment on the commit that no longer appears to be there about the implicit global likely still violating strict mode.

@benjamn benjamn force-pushed the opt-into-strict-mode branch from 9cb742a to 0a40d0a Compare January 14, 2015 17:16
@benjamn benjamn changed the title Opt into strict mode in runtime.js. Allow the runtime to be required as a module, and make it strict-mode-compliant. Jan 14, 2015
@benjamn benjamn force-pushed the opt-into-strict-mode branch from 0a40d0a to 4b570c2 Compare January 14, 2015 17:21
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, "window"??

Specifically, you can now require("regenerator/runtime-module") if you
want to access the runtime without relying on the global namespace.

Note that runtime.js is now fully strict-mode-compliant.

Fixes #165.
Fixes #166.
@benjamn benjamn force-pushed the opt-into-strict-mode branch from 4b570c2 to 0f2c4c5 Compare January 14, 2015 17:29
benjamn added a commit that referenced this pull request Jan 14, 2015
Allow the runtime to be required as a module, and make it strict-mode-compliant.
@benjamn benjamn merged commit addcf0e into master Jan 14, 2015
@fkling
Copy link
Copy Markdown
Contributor

fkling commented Jan 14, 2015

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Runtime defaults to creating a global variable Runtime is not strict mode compliant

4 participants