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

Only add .coffee to extensions if it was present before #98

Merged
merged 1 commit into from
Jul 1, 2016

Conversation

tschaub
Copy link
Contributor

@tschaub tschaub commented May 18, 2016

The restoreExtensions() function currently results in a '.coffee': undefined member in require.extensions.

On Node 5, if I have a script like the one below (where index.js is empty), I get the output below:

var rewire = require('rewire');
console.log(require.extensions);
rewire('./index.js');
console.log(require.extensions);
{ '.js': [Function], '.json': [Function], '.node': [Function] }
{ '.js': [Function],
  '.json': [Function],
  '.node': [Function],
  '.coffee': undefined }

So, no .coffee before, and '.coffee': undefined after.

The changes in this branch make it so require.extensions is not modified if .coffee is not present in the original.

@coveralls
Copy link

coveralls commented May 18, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 5561b8e on tschaub:unmodified-extensions into f126dcb on jhnns:master.

@tschaub
Copy link
Contributor Author

tschaub commented Jun 30, 2016

@jhnns - let me know if I can provide any more detail or do anything else to help get this merged.

@jhnns jhnns merged commit c0694e4 into jhnns:master Jul 1, 2016
@jhnns
Copy link
Owner

jhnns commented Jul 1, 2016

Thx 👍 Has been shipped with 2.5.2

@tschaub tschaub deleted the unmodified-extensions branch July 1, 2016 17:17
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.

3 participants