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

Stop modifying require.extensions in the top level. #3054

Closed
wants to merge 1 commit into from
Closed

Stop modifying require.extensions in the top level. #3054

wants to merge 1 commit into from

Conversation

BYVoid
Copy link

@BYVoid BYVoid commented Jun 29, 2013

require.extensions should not be modified in the top level. For example, variable require.extensions of a script file that loads coffee script by using var coffee = require('coffee-script') is modified unexpectedly. require.extensions should remains as-is until 'run' is explicitly called.

By implementing this, I created another script file named compile-helper.coffee and moved some functions from coffee-script.coffee to it. In 'compile-helper.coffee' the new function is named registerRequire, which replaced the code in the top level before. registerRequire is called in function run of coffee-script.coffee.

@vendethiel
Copy link
Collaborator

See #2323

@jashkenas
Copy link
Owner

Done. You now have to require coffee-script/extensions to enable 'em.

@jashkenas jashkenas closed this Oct 20, 2013
@michaelficarra
Copy link
Collaborator

@jashkenas: Not true. You may want to check out michaelficarra/CoffeeScriptRedux@23a597e to see how I did this in CSR. Let's try to get this fixed up before 1.7.0.

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

Successfully merging this pull request may close these issues.

None yet

4 participants