{"action":"created","issue":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/3501","repository_url":"https://api.github.com/repos/kangax/fabric.js","labels_url":"https://api.github.com/repos/kangax/fabric.js/issues/3501/labels{/name}","comments_url":"https://api.github.com/repos/kangax/fabric.js/issues/3501/comments","events_url":"https://api.github.com/repos/kangax/fabric.js/issues/3501/events","html_url":"https://github.com/kangax/fabric.js/pull/3501","id":193663716,"number":3501,"title":"Ensure clone invokes callback in all cases","user":{"login":"fabiancook","id":4337080,"avatar_url":"https://avatars.githubusercontent.com/u/4337080?v=3","gravatar_id":"","url":"https://api.github.com/users/fabiancook","html_url":"https://github.com/fabiancook","followers_url":"https://api.github.com/users/fabiancook/followers","following_url":"https://api.github.com/users/fabiancook/following{/other_user}","gists_url":"https://api.github.com/users/fabiancook/gists{/gist_id}","starred_url":"https://api.github.com/users/fabiancook/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fabiancook/subscriptions","organizations_url":"https://api.github.com/users/fabiancook/orgs","repos_url":"https://api.github.com/users/fabiancook/repos","events_url":"https://api.github.com/users/fabiancook/events{/privacy}","received_events_url":"https://api.github.com/users/fabiancook/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-12-06T02:04:48Z","updated_at":"2016-12-06T09:33:56Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kangax/fabric.js/pulls/3501","html_url":"https://github.com/kangax/fabric.js/pull/3501","diff_url":"https://github.com/kangax/fabric.js/pull/3501.diff","patch_url":"https://github.com/kangax/fabric.js/pull/3501.patch"},"body":"> Clones an instance, some objects are async, so using callback method will work for every object. \r\n\r\nThis should mean that `callback` is invoked no matter what, however if `this.constructor.fromObject` is not a function then it should never be invoked. \r\n\r\nThis solves the issue by invoking `callback` if the value is just being returned. \r\n\r\n`setTimeout` is used to ensure `callback` is invoked in an *async* fashion"},"comment":{"url":"https://api.github.com/repos/kangax/fabric.js/issues/comments/265103140","html_url":"https://github.com/kangax/fabric.js/pull/3501#issuecomment-265103140","issue_url":"https://api.github.com/repos/kangax/fabric.js/issues/3501","id":265103140,"user":{"login":"asturur","id":1194048,"avatar_url":"https://avatars.githubusercontent.com/u/1194048?v=3","gravatar_id":"","url":"https://api.github.com/users/asturur","html_url":"https://github.com/asturur","followers_url":"https://api.github.com/users/asturur/followers","following_url":"https://api.github.com/users/asturur/following{/other_user}","gists_url":"https://api.github.com/users/asturur/gists{/gist_id}","starred_url":"https://api.github.com/users/asturur/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asturur/subscriptions","organizations_url":"https://api.github.com/users/asturur/orgs","repos_url":"https://api.github.com/users/asturur/repos","events_url":"https://api.github.com/users/asturur/events{/privacy}","received_events_url":"https://api.github.com/users/asturur/received_events","type":"User","site_admin":false},"created_at":"2016-12-06T09:33:56Z","updated_at":"2016-12-06T09:33:56Z","body":"So all the subclasses have a fromObject method, or they can't be cloned.\r\nThis Object.class is just a main class to derive subclasses.\r\nIf you create a fabricObject subclass without a fromObject method, you did a wrong thing or you did your own personal subclass and you will take care of not cloning it.\r\nThere are no subclasses without that method as of now.\r\n\r\nfabricjs code is far from perfect, but is enough big and complicated. I would not add other checks or additions if not to fix actual bugs that show up in real use case."}}
{"actor":{"display_login":"asturur"}}