{"push_id":906454529,"size":1,"distinct_size":1,"ref":"refs/heads/feature/multiple-constructors","head":"67d0080c7b7d46a5a1d4f6048a72c792bff92284","before":"9316ee60ff5205f2566f18d6de38a6ced0c782b9","commits":[{"sha":"67d0080c7b7d46a5a1d4f6048a72c792bff92284","author":{"email":"495cabd5fc2b25e388438d645ee8588a7428d4ad@mirego.com","name":"Mathieu Cote"},"message":"Support multiple constructors for a class\n\nThis is more than crazy!\n\n```java\npublic class SCRATCHError {\n    private final String domain;\n    private final int code;\n    private final String message;\n\n    public SCRATCHError(String domain) {\n        this.domain = domain;\n        this.code = 0;\n        this.message = null;\n    }\n\n    public SCRATCHError(String domain, int code) {\n        this(domain, code, \"no message\");\n    }\n\n    public SCRATCHError(String domain, int code, String message) {\n        this.domain = domain;\n        this.code = code;\n        this.message = message;\n    }\n}\n```\n\n```js\nvar SCRATCHError = function() {\n};\nSCRATCHError = stjs.extend(SCRATCHError, null, [], function(constructor, prototype) {\n    prototype._constructor$String = function(domain) {\n        this._domain = domain;\n        this._domain = null;\n        this._code = 0;\n        return this;\n    };\n    prototype._constructor$String_int = function(domain, code) {\n        this._constructor$String_int_String(domain, code, null);\n        return this;\n    };\n    prototype._constructor$String_int_String = function(domain, code, message) {\n        this._code = code;\n        this._message = message;\n        return this;\n    };\n\n    prototype._domain = null;\n    prototype._code = 0;\n    prototype._message = null;\n\n    prototype.getDomain = function() {\n        return this._domain;\n    };\n    prototype.getCode = function() {\n        return this._code;\n    };\n    prototype.getMessage = function() {\n        return this._message;\n    };\n}, {}, {});\n\nscratchError = new SCRATCHError()._constructor$String_int_String(\"domain\", 400, \"Big Error\");\n\nscratchError2 = new SCRATCHError()._constructor$String(\"test\");\n\nscratchError3 = new SCRATCHError()._constructor$String_int(\"test\", 200);\n```","distinct":true,"url":"https://api.github.com/repos/mirego/st-js/commits/67d0080c7b7d46a5a1d4f6048a72c792bff92284"}]}