-
Notifications
You must be signed in to change notification settings - Fork 499
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
change condition of using node export system. #41
Conversation
The original condition of using node export system causes error when used with QUnit.
if (typeof module !== 'undefined' && module.exports) { | ||
exports = module.exports = JsDiff; | ||
} | ||
exports.JsDiff = JsDiff; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This materially changes the export. Why creating the named, circular export?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this pattern at underscore.js export pattern
Add support for CommonJS implementations that do not support modules.exports. mention about this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having gone this long without anyone complaining (and my sense is that node has won out), I'd rather not add this API as it effectively makes the API conditional on the environment. If you remove this line I'm fine merging the rest.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay I'll fix that line~ :D
change condition of using node export system.
Released in 1.2.1 |
I am proud of contributing your repo.. thank you! |
The original condition of using node export system causes error when used with QUnit.
QUnit's 'module' Function is defined globaly.
So current export logic is malfunctioning.
I change that logic more precise.