{"action":"created","comment":{"url":"https://api.github.com/repos/ftdebugger/di.js/pulls/comments/72904177","id":72904177,"diff_hunk":"@@ -889,10 +889,8 @@ let createContainer = ({resolvers = [], dependencies = {}, factories, definition\n \n         if (!definition.reuse) {\n             destroyObject(instance, options);\n-            definition.instance = null;\n-        } else {\n-            delete definition.instance;\n         }\n+        definition.instance = null;","path":"index.js","position":8,"original_position":8,"commit_id":"0a1219384235f7f6d785ccd740280083f3e683e0","original_commit_id":"0a1219384235f7f6d785ccd740280083f3e683e0","user":{"login":"ftdebugger","id":170282,"avatar_url":"https://avatars.githubusercontent.com/u/170282?v=3","gravatar_id":"","url":"https://api.github.com/users/ftdebugger","html_url":"https://github.com/ftdebugger","followers_url":"https://api.github.com/users/ftdebugger/followers","following_url":"https://api.github.com/users/ftdebugger/following{/other_user}","gists_url":"https://api.github.com/users/ftdebugger/gists{/gist_id}","starred_url":"https://api.github.com/users/ftdebugger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftdebugger/subscriptions","organizations_url":"https://api.github.com/users/ftdebugger/orgs","repos_url":"https://api.github.com/users/ftdebugger/repos","events_url":"https://api.github.com/users/ftdebugger/events{/privacy}","received_events_url":"https://api.github.com/users/ftdebugger/received_events","type":"User","site_admin":false},"body":"For example we have `B: '!A'` and `C: '!A'`, then:\r\n\r\nSession 1:\r\n\r\n```\r\ndi('B');\r\n```\r\n\r\nWe create instance with `B` dependencies and put it on `B` and `A`.\r\n\r\nSession 2:\r\n\r\n\r\n```\r\ndi('C');\r\n```\r\n\r\n`C` has no instance and see through `__proto__` instance of `A`, it detect, that it was created in another session and make `updateDependences` on it. So `A` and `C` now has dependencies of `C` and it marked as updated. `B` has same instance too, but it will be destroyed at the end of process. We delete instance property from `B` definition.  \r\n\r\n\r\nSession 3:\r\n\r\n```\r\ndi('B');\r\n```\r\n\r\nBecause `instance` of `B` definition is not set, it found `instance` in `A` by `__proto__` link. All process will be same as in session 2.\r\n\r\nSituation, when we request `B` and `C` dependency in same session is incorrect, because we have undefined behavior of which dependencies to use (instance shared between all of them). Mister @next0 suggest to check this and throw Error, but it not implemented yet. ","created_at":"2016-07-31T13:29:43Z","updated_at":"2016-07-31T13:29:43Z","html_url":"https://github.com/ftdebugger/di.js/pull/12#discussion_r72904177","pull_request_url":"https://api.github.com/repos/ftdebugger/di.js/pulls/12","_links":{"self":{"href":"https://api.github.com/repos/ftdebugger/di.js/pulls/comments/72904177"},"html":{"href":"https://github.com/ftdebugger/di.js/pull/12#discussion_r72904177"},"pull_request":{"href":"https://api.github.com/repos/ftdebugger/di.js/pulls/12"}}},"pull_request":{"url":"https://api.github.com/repos/ftdebugger/di.js/pulls/12","id":79481194,"html_url":"https://github.com/ftdebugger/di.js/pull/12","diff_url":"https://github.com/ftdebugger/di.js/pull/12.diff","patch_url":"https://github.com/ftdebugger/di.js/pull/12.patch","issue_url":"https://api.github.com/repos/ftdebugger/di.js/issues/12","number":12,"state":"open","locked":false,"title":"Perfomance: optimize delete","user":{"login":"akwuh","id":11235552,"avatar_url":"https://avatars.githubusercontent.com/u/11235552?v=3","gravatar_id":"","url":"https://api.github.com/users/akwuh","html_url":"https://github.com/akwuh","followers_url":"https://api.github.com/users/akwuh/followers","following_url":"https://api.github.com/users/akwuh/following{/other_user}","gists_url":"https://api.github.com/users/akwuh/gists{/gist_id}","starred_url":"https://api.github.com/users/akwuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akwuh/subscriptions","organizations_url":"https://api.github.com/users/akwuh/orgs","repos_url":"https://api.github.com/users/akwuh/repos","events_url":"https://api.github.com/users/akwuh/events{/privacy}","received_events_url":"https://api.github.com/users/akwuh/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-31T10:05:10Z","updated_at":"2016-07-31T13:29:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fae13e7dca6c13f421fc84e4ca94f522599d6cf3","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ftdebugger/di.js/pulls/12/commits","review_comments_url":"https://api.github.com/repos/ftdebugger/di.js/pulls/12/comments","review_comment_url":"https://api.github.com/repos/ftdebugger/di.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ftdebugger/di.js/issues/12/comments","statuses_url":"https://api.github.com/repos/ftdebugger/di.js/statuses/0a1219384235f7f6d785ccd740280083f3e683e0","head":{"label":"akwuh:perfomance/optimize-delete","ref":"perfomance/optimize-delete","sha":"0a1219384235f7f6d785ccd740280083f3e683e0","user":{"login":"akwuh","id":11235552,"avatar_url":"https://avatars.githubusercontent.com/u/11235552?v=3","gravatar_id":"","url":"https://api.github.com/users/akwuh","html_url":"https://github.com/akwuh","followers_url":"https://api.github.com/users/akwuh/followers","following_url":"https://api.github.com/users/akwuh/following{/other_user}","gists_url":"https://api.github.com/users/akwuh/gists{/gist_id}","starred_url":"https://api.github.com/users/akwuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akwuh/subscriptions","organizations_url":"https://api.github.com/users/akwuh/orgs","repos_url":"https://api.github.com/users/akwuh/repos","events_url":"https://api.github.com/users/akwuh/events{/privacy}","received_events_url":"https://api.github.com/users/akwuh/received_events","type":"User","site_admin":false},"repo":{"id":64584682,"name":"di.js","full_name":"akwuh/di.js","owner":{"login":"akwuh","id":11235552,"avatar_url":"https://avatars.githubusercontent.com/u/11235552?v=3","gravatar_id":"","url":"https://api.github.com/users/akwuh","html_url":"https://github.com/akwuh","followers_url":"https://api.github.com/users/akwuh/followers","following_url":"https://api.github.com/users/akwuh/following{/other_user}","gists_url":"https://api.github.com/users/akwuh/gists{/gist_id}","starred_url":"https://api.github.com/users/akwuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akwuh/subscriptions","organizations_url":"https://api.github.com/users/akwuh/orgs","repos_url":"https://api.github.com/users/akwuh/repos","events_url":"https://api.github.com/users/akwuh/events{/privacy}","received_events_url":"https://api.github.com/users/akwuh/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akwuh/di.js","description":"Dependency Injection container with webpack flower","fork":true,"url":"https://api.github.com/repos/akwuh/di.js","forks_url":"https://api.github.com/repos/akwuh/di.js/forks","keys_url":"https://api.github.com/repos/akwuh/di.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akwuh/di.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akwuh/di.js/teams","hooks_url":"https://api.github.com/repos/akwuh/di.js/hooks","issue_events_url":"https://api.github.com/repos/akwuh/di.js/issues/events{/number}","events_url":"https://api.github.com/repos/akwuh/di.js/events","assignees_url":"https://api.github.com/repos/akwuh/di.js/assignees{/user}","branches_url":"https://api.github.com/repos/akwuh/di.js/branches{/branch}","tags_url":"https://api.github.com/repos/akwuh/di.js/tags","blobs_url":"https://api.github.com/repos/akwuh/di.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akwuh/di.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akwuh/di.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/akwuh/di.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akwuh/di.js/statuses/{sha}","languages_url":"https://api.github.com/repos/akwuh/di.js/languages","stargazers_url":"https://api.github.com/repos/akwuh/di.js/stargazers","contributors_url":"https://api.github.com/repos/akwuh/di.js/contributors","subscribers_url":"https://api.github.com/repos/akwuh/di.js/subscribers","subscription_url":"https://api.github.com/repos/akwuh/di.js/subscription","commits_url":"https://api.github.com/repos/akwuh/di.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/akwuh/di.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/akwuh/di.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/akwuh/di.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/akwuh/di.js/contents/{+path}","compare_url":"https://api.github.com/repos/akwuh/di.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akwuh/di.js/merges","archive_url":"https://api.github.com/repos/akwuh/di.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akwuh/di.js/downloads","issues_url":"https://api.github.com/repos/akwuh/di.js/issues{/number}","pulls_url":"https://api.github.com/repos/akwuh/di.js/pulls{/number}","milestones_url":"https://api.github.com/repos/akwuh/di.js/milestones{/number}","notifications_url":"https://api.github.com/repos/akwuh/di.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akwuh/di.js/labels{/name}","releases_url":"https://api.github.com/repos/akwuh/di.js/releases{/id}","deployments_url":"https://api.github.com/repos/akwuh/di.js/deployments","created_at":"2016-07-31T08:35:19Z","updated_at":"2016-07-31T08:35:20Z","pushed_at":"2016-07-31T10:04:48Z","git_url":"git://github.com/akwuh/di.js.git","ssh_url":"git@github.com:akwuh/di.js.git","clone_url":"https://github.com/akwuh/di.js.git","svn_url":"https://github.com/akwuh/di.js","homepage":"","size":122,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"ftdebugger:master","ref":"master","sha":"c2e92ca2020633850545cdfbbc1f14accc12b8ce","user":{"login":"ftdebugger","id":170282,"avatar_url":"https://avatars.githubusercontent.com/u/170282?v=3","gravatar_id":"","url":"https://api.github.com/users/ftdebugger","html_url":"https://github.com/ftdebugger","followers_url":"https://api.github.com/users/ftdebugger/followers","following_url":"https://api.github.com/users/ftdebugger/following{/other_user}","gists_url":"https://api.github.com/users/ftdebugger/gists{/gist_id}","starred_url":"https://api.github.com/users/ftdebugger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftdebugger/subscriptions","organizations_url":"https://api.github.com/users/ftdebugger/orgs","repos_url":"https://api.github.com/users/ftdebugger/repos","events_url":"https://api.github.com/users/ftdebugger/events{/privacy}","received_events_url":"https://api.github.com/users/ftdebugger/received_events","type":"User","site_admin":false},"repo":{"id":41559528,"name":"di.js","full_name":"ftdebugger/di.js","owner":{"login":"ftdebugger","id":170282,"avatar_url":"https://avatars.githubusercontent.com/u/170282?v=3","gravatar_id":"","url":"https://api.github.com/users/ftdebugger","html_url":"https://github.com/ftdebugger","followers_url":"https://api.github.com/users/ftdebugger/followers","following_url":"https://api.github.com/users/ftdebugger/following{/other_user}","gists_url":"https://api.github.com/users/ftdebugger/gists{/gist_id}","starred_url":"https://api.github.com/users/ftdebugger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftdebugger/subscriptions","organizations_url":"https://api.github.com/users/ftdebugger/orgs","repos_url":"https://api.github.com/users/ftdebugger/repos","events_url":"https://api.github.com/users/ftdebugger/events{/privacy}","received_events_url":"https://api.github.com/users/ftdebugger/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ftdebugger/di.js","description":"Dependency Injection container with webpack flower","fork":false,"url":"https://api.github.com/repos/ftdebugger/di.js","forks_url":"https://api.github.com/repos/ftdebugger/di.js/forks","keys_url":"https://api.github.com/repos/ftdebugger/di.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ftdebugger/di.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ftdebugger/di.js/teams","hooks_url":"https://api.github.com/repos/ftdebugger/di.js/hooks","issue_events_url":"https://api.github.com/repos/ftdebugger/di.js/issues/events{/number}","events_url":"https://api.github.com/repos/ftdebugger/di.js/events","assignees_url":"https://api.github.com/repos/ftdebugger/di.js/assignees{/user}","branches_url":"https://api.github.com/repos/ftdebugger/di.js/branches{/branch}","tags_url":"https://api.github.com/repos/ftdebugger/di.js/tags","blobs_url":"https://api.github.com/repos/ftdebugger/di.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ftdebugger/di.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ftdebugger/di.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/ftdebugger/di.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ftdebugger/di.js/statuses/{sha}","languages_url":"https://api.github.com/repos/ftdebugger/di.js/languages","stargazers_url":"https://api.github.com/repos/ftdebugger/di.js/stargazers","contributors_url":"https://api.github.com/repos/ftdebugger/di.js/contributors","subscribers_url":"https://api.github.com/repos/ftdebugger/di.js/subscribers","subscription_url":"https://api.github.com/repos/ftdebugger/di.js/subscription","commits_url":"https://api.github.com/repos/ftdebugger/di.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/ftdebugger/di.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/ftdebugger/di.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/ftdebugger/di.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/ftdebugger/di.js/contents/{+path}","compare_url":"https://api.github.com/repos/ftdebugger/di.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ftdebugger/di.js/merges","archive_url":"https://api.github.com/repos/ftdebugger/di.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ftdebugger/di.js/downloads","issues_url":"https://api.github.com/repos/ftdebugger/di.js/issues{/number}","pulls_url":"https://api.github.com/repos/ftdebugger/di.js/pulls{/number}","milestones_url":"https://api.github.com/repos/ftdebugger/di.js/milestones{/number}","notifications_url":"https://api.github.com/repos/ftdebugger/di.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ftdebugger/di.js/labels{/name}","releases_url":"https://api.github.com/repos/ftdebugger/di.js/releases{/id}","deployments_url":"https://api.github.com/repos/ftdebugger/di.js/deployments","created_at":"2015-08-28T17:13:15Z","updated_at":"2016-07-31T08:25:34Z","pushed_at":"2016-07-31T10:05:10Z","git_url":"git://github.com/ftdebugger/di.js.git","ssh_url":"git@github.com:ftdebugger/di.js.git","clone_url":"https://github.com/ftdebugger/di.js.git","svn_url":"https://github.com/ftdebugger/di.js","homepage":"","size":120,"stargazers_count":4,"watchers_count":4,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":4,"forks":2,"open_issues":4,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ftdebugger/di.js/pulls/12"},"html":{"href":"https://github.com/ftdebugger/di.js/pull/12"},"issue":{"href":"https://api.github.com/repos/ftdebugger/di.js/issues/12"},"comments":{"href":"https://api.github.com/repos/ftdebugger/di.js/issues/12/comments"},"review_comments":{"href":"https://api.github.com/repos/ftdebugger/di.js/pulls/12/comments"},"review_comment":{"href":"https://api.github.com/repos/ftdebugger/di.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ftdebugger/di.js/pulls/12/commits"},"statuses":{"href":"https://api.github.com/repos/ftdebugger/di.js/statuses/0a1219384235f7f6d785ccd740280083f3e683e0"}}}}
{"actor":{"display_login":"ftdebugger"}}