{"action":"created","comment":{"url":"https://api.github.com/repos/cerebral/cerebral/pulls/comments/130140074","pull_request_review_id":52987689,"id":130140074,"diff_hunk":"@@ -277,33 +277,24 @@ export function createDummyController(state = {}, signals = {}) {\n }\n \n export function copyAndFreezeObject(rootObject) {\n-  function makeCopy(value) {\n-    if (Array.isArray(value)) {\n-      return value.slice()\n-    } else if (isObject(value)) {\n-      return Object.assign({}, value)\n-    }\n-\n-    return value\n+  function deepFreeze(val) {\n+    if (isObject(val)) return deepFreezeObject(val)\n+    if (Array.isArray(val)) return deepFreezeArray(val)\n+    return val\n   }\n-\n-  function freezeObject(object) {\n-    if (!Object.isFrozen(object) && isComplexObject(object)) {\n-      for (const key in object) {\n-        // Properties might not be writable, but then there\n-        // is not reason to freeze its value either\n-        try {\n-          object[key] = freezeObject(object[key])\n-        } catch (e) {}\n-      }\n-\n-      return Object.freeze(makeCopy(object))\n-    }\n-\n-    return object\n+  function deepFreezeObject(obj) {\n+    Object.getOwnPropertyNames(obj).forEach(name => {\n+      deepFreeze(obj[name])\n+    })\n+    return Object.freeze(obj)\n   }\n-\n-  return freezeObject(rootObject)\n+  function deepFreezeArray(arr) {\n+    arr.forEach(val => {\n+      deepFreeze(val)","path":"packages/node_modules/cerebral/src/utils.js","position":42,"original_position":42,"commit_id":"e93aef34dab9022ef8857d6247213e02d4a972b4","original_commit_id":"e93aef34dab9022ef8857d6247213e02d4a972b4","user":{"login":"sladiri","id":5485639,"avatar_url":"https://avatars2.githubusercontent.com/u/5485639?v=4","gravatar_id":"","url":"https://api.github.com/users/sladiri","html_url":"https://github.com/sladiri","followers_url":"https://api.github.com/users/sladiri/followers","following_url":"https://api.github.com/users/sladiri/following{/other_user}","gists_url":"https://api.github.com/users/sladiri/gists{/gist_id}","starred_url":"https://api.github.com/users/sladiri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sladiri/subscriptions","organizations_url":"https://api.github.com/users/sladiri/orgs","repos_url":"https://api.github.com/users/sladiri/repos","events_url":"https://api.github.com/users/sladiri/events{/privacy}","received_events_url":"https://api.github.com/users/sladiri/received_events","type":"User","site_admin":false},"body":"Similar to above, I think you need to map the array with the freeze function?","created_at":"2017-07-28T17:14:39Z","updated_at":"2017-07-28T17:14:39Z","html_url":"https://github.com/cerebral/cerebral/pull/1015#discussion_r130140074","pull_request_url":"https://api.github.com/repos/cerebral/cerebral/pulls/1015","_links":{"self":{"href":"https://api.github.com/repos/cerebral/cerebral/pulls/comments/130140074"},"html":{"href":"https://github.com/cerebral/cerebral/pull/1015#discussion_r130140074"},"pull_request":{"href":"https://api.github.com/repos/cerebral/cerebral/pulls/1015"}}},"pull_request":{"url":"https://api.github.com/repos/cerebral/cerebral/pulls/1015","id":132886935,"html_url":"https://github.com/cerebral/cerebral/pull/1015","diff_url":"https://github.com/cerebral/cerebral/pull/1015.diff","patch_url":"https://github.com/cerebral/cerebral/pull/1015.patch","issue_url":"https://api.github.com/repos/cerebral/cerebral/issues/1015","number":1015,"state":"open","locked":false,"title":"fix(utils): fixed copyAndFreezeObject to not interfere with original state","user":{"login":"naturalethic","id":1254,"avatar_url":"https://avatars1.githubusercontent.com/u/1254?v=4","gravatar_id":"","url":"https://api.github.com/users/naturalethic","html_url":"https://github.com/naturalethic","followers_url":"https://api.github.com/users/naturalethic/followers","following_url":"https://api.github.com/users/naturalethic/following{/other_user}","gists_url":"https://api.github.com/users/naturalethic/gists{/gist_id}","starred_url":"https://api.github.com/users/naturalethic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naturalethic/subscriptions","organizations_url":"https://api.github.com/users/naturalethic/orgs","repos_url":"https://api.github.com/users/naturalethic/repos","events_url":"https://api.github.com/users/naturalethic/events{/privacy}","received_events_url":"https://api.github.com/users/naturalethic/received_events","type":"User","site_admin":false},"body":"","created_at":"2017-07-28T03:14:21Z","updated_at":"2017-07-28T17:14:39Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7d8594a29497891173d99f37e6633921f9805a0c","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/cerebral/cerebral/pulls/1015/commits","review_comments_url":"https://api.github.com/repos/cerebral/cerebral/pulls/1015/comments","review_comment_url":"https://api.github.com/repos/cerebral/cerebral/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cerebral/cerebral/issues/1015/comments","statuses_url":"https://api.github.com/repos/cerebral/cerebral/statuses/e93aef34dab9022ef8857d6247213e02d4a972b4","head":{"label":"naturalethic:copy-and-freeze-object-fix-to-not-alter-original-state","ref":"copy-and-freeze-object-fix-to-not-alter-original-state","sha":"e93aef34dab9022ef8857d6247213e02d4a972b4","user":{"login":"naturalethic","id":1254,"avatar_url":"https://avatars1.githubusercontent.com/u/1254?v=4","gravatar_id":"","url":"https://api.github.com/users/naturalethic","html_url":"https://github.com/naturalethic","followers_url":"https://api.github.com/users/naturalethic/followers","following_url":"https://api.github.com/users/naturalethic/following{/other_user}","gists_url":"https://api.github.com/users/naturalethic/gists{/gist_id}","starred_url":"https://api.github.com/users/naturalethic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naturalethic/subscriptions","organizations_url":"https://api.github.com/users/naturalethic/orgs","repos_url":"https://api.github.com/users/naturalethic/repos","events_url":"https://api.github.com/users/naturalethic/events{/privacy}","received_events_url":"https://api.github.com/users/naturalethic/received_events","type":"User","site_admin":false},"repo":{"id":98602241,"name":"cerebral","full_name":"naturalethic/cerebral","owner":{"login":"naturalethic","id":1254,"avatar_url":"https://avatars1.githubusercontent.com/u/1254?v=4","gravatar_id":"","url":"https://api.github.com/users/naturalethic","html_url":"https://github.com/naturalethic","followers_url":"https://api.github.com/users/naturalethic/followers","following_url":"https://api.github.com/users/naturalethic/following{/other_user}","gists_url":"https://api.github.com/users/naturalethic/gists{/gist_id}","starred_url":"https://api.github.com/users/naturalethic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naturalethic/subscriptions","organizations_url":"https://api.github.com/users/naturalethic/orgs","repos_url":"https://api.github.com/users/naturalethic/repos","events_url":"https://api.github.com/users/naturalethic/events{/privacy}","received_events_url":"https://api.github.com/users/naturalethic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/naturalethic/cerebral","description":"A state controller with its own debugger","fork":true,"url":"https://api.github.com/repos/naturalethic/cerebral","forks_url":"https://api.github.com/repos/naturalethic/cerebral/forks","keys_url":"https://api.github.com/repos/naturalethic/cerebral/keys{/key_id}","collaborators_url":"https://api.github.com/repos/naturalethic/cerebral/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/naturalethic/cerebral/teams","hooks_url":"https://api.github.com/repos/naturalethic/cerebral/hooks","issue_events_url":"https://api.github.com/repos/naturalethic/cerebral/issues/events{/number}","events_url":"https://api.github.com/repos/naturalethic/cerebral/events","assignees_url":"https://api.github.com/repos/naturalethic/cerebral/assignees{/user}","branches_url":"https://api.github.com/repos/naturalethic/cerebral/branches{/branch}","tags_url":"https://api.github.com/repos/naturalethic/cerebral/tags","blobs_url":"https://api.github.com/repos/naturalethic/cerebral/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/naturalethic/cerebral/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/naturalethic/cerebral/git/refs{/sha}","trees_url":"https://api.github.com/repos/naturalethic/cerebral/git/trees{/sha}","statuses_url":"https://api.github.com/repos/naturalethic/cerebral/statuses/{sha}","languages_url":"https://api.github.com/repos/naturalethic/cerebral/languages","stargazers_url":"https://api.github.com/repos/naturalethic/cerebral/stargazers","contributors_url":"https://api.github.com/repos/naturalethic/cerebral/contributors","subscribers_url":"https://api.github.com/repos/naturalethic/cerebral/subscribers","subscription_url":"https://api.github.com/repos/naturalethic/cerebral/subscription","commits_url":"https://api.github.com/repos/naturalethic/cerebral/commits{/sha}","git_commits_url":"https://api.github.com/repos/naturalethic/cerebral/git/commits{/sha}","comments_url":"https://api.github.com/repos/naturalethic/cerebral/comments{/number}","issue_comment_url":"https://api.github.com/repos/naturalethic/cerebral/issues/comments{/number}","contents_url":"https://api.github.com/repos/naturalethic/cerebral/contents/{+path}","compare_url":"https://api.github.com/repos/naturalethic/cerebral/compare/{base}...{head}","merges_url":"https://api.github.com/repos/naturalethic/cerebral/merges","archive_url":"https://api.github.com/repos/naturalethic/cerebral/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/naturalethic/cerebral/downloads","issues_url":"https://api.github.com/repos/naturalethic/cerebral/issues{/number}","pulls_url":"https://api.github.com/repos/naturalethic/cerebral/pulls{/number}","milestones_url":"https://api.github.com/repos/naturalethic/cerebral/milestones{/number}","notifications_url":"https://api.github.com/repos/naturalethic/cerebral/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/naturalethic/cerebral/labels{/name}","releases_url":"https://api.github.com/repos/naturalethic/cerebral/releases{/id}","deployments_url":"https://api.github.com/repos/naturalethic/cerebral/deployments","created_at":"2017-07-28T03:05:17Z","updated_at":"2017-07-28T03:05:19Z","pushed_at":"2017-07-28T17:04:18Z","git_url":"git://github.com/naturalethic/cerebral.git","ssh_url":"git@github.com:naturalethic/cerebral.git","clone_url":"https://github.com/naturalethic/cerebral.git","svn_url":"https://github.com/naturalethic/cerebral","homepage":"http://cerebraljs.com","size":9287,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"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":"next"}},"base":{"label":"cerebral:next","ref":"next","sha":"77e4a3c2d7ed2a97cdb46f2999b5eba7fc5e6a2f","user":{"login":"cerebral","id":15994611,"avatar_url":"https://avatars1.githubusercontent.com/u/15994611?v=4","gravatar_id":"","url":"https://api.github.com/users/cerebral","html_url":"https://github.com/cerebral","followers_url":"https://api.github.com/users/cerebral/followers","following_url":"https://api.github.com/users/cerebral/following{/other_user}","gists_url":"https://api.github.com/users/cerebral/gists{/gist_id}","starred_url":"https://api.github.com/users/cerebral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerebral/subscriptions","organizations_url":"https://api.github.com/users/cerebral/orgs","repos_url":"https://api.github.com/users/cerebral/repos","events_url":"https://api.github.com/users/cerebral/events{/privacy}","received_events_url":"https://api.github.com/users/cerebral/received_events","type":"Organization","site_admin":false},"repo":{"id":35326416,"name":"cerebral","full_name":"cerebral/cerebral","owner":{"login":"cerebral","id":15994611,"avatar_url":"https://avatars1.githubusercontent.com/u/15994611?v=4","gravatar_id":"","url":"https://api.github.com/users/cerebral","html_url":"https://github.com/cerebral","followers_url":"https://api.github.com/users/cerebral/followers","following_url":"https://api.github.com/users/cerebral/following{/other_user}","gists_url":"https://api.github.com/users/cerebral/gists{/gist_id}","starred_url":"https://api.github.com/users/cerebral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cerebral/subscriptions","organizations_url":"https://api.github.com/users/cerebral/orgs","repos_url":"https://api.github.com/users/cerebral/repos","events_url":"https://api.github.com/users/cerebral/events{/privacy}","received_events_url":"https://api.github.com/users/cerebral/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cerebral/cerebral","description":"A state controller with its own debugger","fork":false,"url":"https://api.github.com/repos/cerebral/cerebral","forks_url":"https://api.github.com/repos/cerebral/cerebral/forks","keys_url":"https://api.github.com/repos/cerebral/cerebral/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cerebral/cerebral/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cerebral/cerebral/teams","hooks_url":"https://api.github.com/repos/cerebral/cerebral/hooks","issue_events_url":"https://api.github.com/repos/cerebral/cerebral/issues/events{/number}","events_url":"https://api.github.com/repos/cerebral/cerebral/events","assignees_url":"https://api.github.com/repos/cerebral/cerebral/assignees{/user}","branches_url":"https://api.github.com/repos/cerebral/cerebral/branches{/branch}","tags_url":"https://api.github.com/repos/cerebral/cerebral/tags","blobs_url":"https://api.github.com/repos/cerebral/cerebral/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cerebral/cerebral/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cerebral/cerebral/git/refs{/sha}","trees_url":"https://api.github.com/repos/cerebral/cerebral/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cerebral/cerebral/statuses/{sha}","languages_url":"https://api.github.com/repos/cerebral/cerebral/languages","stargazers_url":"https://api.github.com/repos/cerebral/cerebral/stargazers","contributors_url":"https://api.github.com/repos/cerebral/cerebral/contributors","subscribers_url":"https://api.github.com/repos/cerebral/cerebral/subscribers","subscription_url":"https://api.github.com/repos/cerebral/cerebral/subscription","commits_url":"https://api.github.com/repos/cerebral/cerebral/commits{/sha}","git_commits_url":"https://api.github.com/repos/cerebral/cerebral/git/commits{/sha}","comments_url":"https://api.github.com/repos/cerebral/cerebral/comments{/number}","issue_comment_url":"https://api.github.com/repos/cerebral/cerebral/issues/comments{/number}","contents_url":"https://api.github.com/repos/cerebral/cerebral/contents/{+path}","compare_url":"https://api.github.com/repos/cerebral/cerebral/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cerebral/cerebral/merges","archive_url":"https://api.github.com/repos/cerebral/cerebral/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cerebral/cerebral/downloads","issues_url":"https://api.github.com/repos/cerebral/cerebral/issues{/number}","pulls_url":"https://api.github.com/repos/cerebral/cerebral/pulls{/number}","milestones_url":"https://api.github.com/repos/cerebral/cerebral/milestones{/number}","notifications_url":"https://api.github.com/repos/cerebral/cerebral/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cerebral/cerebral/labels{/name}","releases_url":"https://api.github.com/repos/cerebral/cerebral/releases{/id}","deployments_url":"https://api.github.com/repos/cerebral/cerebral/deployments","created_at":"2015-05-09T11:40:05Z","updated_at":"2017-07-28T09:51:37Z","pushed_at":"2017-07-28T17:04:20Z","git_url":"git://github.com/cerebral/cerebral.git","ssh_url":"git@github.com:cerebral/cerebral.git","clone_url":"https://github.com/cerebral/cerebral.git","svn_url":"https://github.com/cerebral/cerebral","homepage":"http://cerebraljs.com","size":9290,"stargazers_count":1130,"watchers_count":1130,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":73,"mirror_url":null,"open_issues_count":52,"forks":73,"open_issues":52,"watchers":1130,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/cerebral/cerebral/pulls/1015"},"html":{"href":"https://github.com/cerebral/cerebral/pull/1015"},"issue":{"href":"https://api.github.com/repos/cerebral/cerebral/issues/1015"},"comments":{"href":"https://api.github.com/repos/cerebral/cerebral/issues/1015/comments"},"review_comments":{"href":"https://api.github.com/repos/cerebral/cerebral/pulls/1015/comments"},"review_comment":{"href":"https://api.github.com/repos/cerebral/cerebral/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cerebral/cerebral/pulls/1015/commits"},"statuses":{"href":"https://api.github.com/repos/cerebral/cerebral/statuses/e93aef34dab9022ef8857d6247213e02d4a972b4"}}}}
{"actor":{"display_login":"sladiri"}}