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

Call initialize method, if not exists then call init. Many nodejs module... #1

Closed
wants to merge 1 commit into from

Conversation

bbtx0
Copy link
Contributor

@bbtx0 bbtx0 commented May 9, 2012

... already use init as primary method, it will cause errors.

…ule already use init as primary method, it will cause errors.
@daffl
Copy link
Owner

daffl commented May 9, 2012

Thanks! What would you think about making this a little more flexible and adding an option to map the init methodname (which in fact is the only name that could cause an error):

{
    "__init" : "myFn",
    "myFn" : function() {
        // This is now being used as the constructor
    }
}

@bbtx0
Copy link
Contributor Author

bbtx0 commented May 9, 2012

It sounds perfect.

daffl added a commit that referenced this pull request May 10, 2012
@daffl
Copy link
Owner

daffl commented May 10, 2012

I just pushed a new version 1.0.2 and published it to NPM. It works as described above. Hope that help!

@daffl daffl closed this May 10, 2012
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