Skip to content

Fix of amd module definition #24

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

Closed
wants to merge 1 commit into from
Closed

Fix of amd module definition #24

wants to merge 1 commit into from

Conversation

morpheus-87
Copy link

This pull request fixes an error in the definition of the amd module.

When requiring the module with a module loader, e.g. RequireJS, the return value was always an empty string. The reason for this behaviour is, that the second argument of the define function gets executed. So, in your way, the function striptags was called without arguments and returned an empty string.

ericnorris added a commit that referenced this pull request Feb 5, 2017
v3.0.0 incorrectly passed the striptags function to `define`,
when it should have passed in a module factory that returns the
striptags function. See #24.
@ericnorris
Copy link
Owner

ericnorris commented Feb 5, 2017

Good catch, @morpheus-87! I had made a test to make sure that I did the AMD stuff properly, but I was testing it to the incorrect specification. I implemented your change and also updated the test to make sure it's defined properly in the future.

Can you confirm it fixes the issue on your end?

@morpheus-87
Copy link
Author

I can confirm, that your changes fix the issue. But why didn't you just merge my request?

@ericnorris
Copy link
Owner

I first wrote a change to the test that verifies AMD is done properly. Considering it was a one line change to then fix the problem, I didn't see a particular need to spend time merging your request when I already had my editor open.

Thanks again for reporting the issue!

@ericnorris ericnorris closed this Feb 5, 2017
@morpheus-87 morpheus-87 deleted the fix/amd-module branch May 24, 2017 06:57
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.

2 participants