We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The objects need to be cloned before being added in order to prevent different classes extending the same mixin from referencing the same properties.
The example needs to be amended as such :
clone = (obj) -> if not obj? or typeof obj isnt 'object' return obj newInstance = new obj.constructor() for key of obj newInstance[key] = clone obj[key] return newInstance moduleKeywords = ['extended', 'included'] class Module @extend: (obj) -> for key, value of obj when key not in moduleKeywords @[key] = clone value obj.extended?.apply(@) this @include: (obj) -> for key, value of obj when key not in moduleKeywords @::[key] = clone value obj.included?.apply(@) this
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The objects need to be cloned before being added in order to prevent different classes extending the same mixin from referencing the same properties.
The example needs to be amended as such :
The text was updated successfully, but these errors were encountered: