{"action":"created","comment":{"url":"https://api.github.com/repos/aframevr/aframe/pulls/comments/131833092","pull_request_review_id":54847885,"id":131833092,"diff_hunk":"@@ -487,6 +489,24 @@ module.exports.registerComponent = function (name, definition) {\n };\n \n /**\n+* Clones component data.\n+* Clones only the properties that are plain objects while\n+* keeping a reference for the rest.\n+*\n+* @param data - Component data to clone.\n+* @returns Cloned data.\n+*/\n+function cloneData (data) {\n+  var clone = {};\n+  var parsedProperty;\n+  for (var key in data) {","path":"src/core/component.js","position":43,"original_position":43,"commit_id":"2bd9451095e4dc0c30a8599007f7c8574ef4aff6","original_commit_id":"2bd9451095e4dc0c30a8599007f7c8574ef4aff6","user":{"login":"ngokevin","id":674727,"avatar_url":"https://avatars2.githubusercontent.com/u/674727?v=4","gravatar_id":"","url":"https://api.github.com/users/ngokevin","html_url":"https://github.com/ngokevin","followers_url":"https://api.github.com/users/ngokevin/followers","following_url":"https://api.github.com/users/ngokevin/following{/other_user}","gists_url":"https://api.github.com/users/ngokevin/gists{/gist_id}","starred_url":"https://api.github.com/users/ngokevin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ngokevin/subscriptions","organizations_url":"https://api.github.com/users/ngokevin/orgs","repos_url":"https://api.github.com/users/ngokevin/repos","events_url":"https://api.github.com/users/ngokevin/events{/privacy}","received_events_url":"https://api.github.com/users/ngokevin/received_events","type":"User","site_admin":false},"body":"declare vars up top.\r\n\r\ni wonder if we should start to use `for (key in obj)` for every loop over an object where we know it's a plain JS object. e.g., change some of the code in the `buildData` to also use `for...in`","created_at":"2017-08-08T06:50:54Z","updated_at":"2017-08-08T06:50:54Z","html_url":"https://github.com/aframevr/aframe/pull/2939#discussion_r131833092","pull_request_url":"https://api.github.com/repos/aframevr/aframe/pulls/2939","_links":{"self":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/comments/131833092"},"html":{"href":"https://github.com/aframevr/aframe/pull/2939#discussion_r131833092"},"pull_request":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/2939"}}},"pull_request":{"url":"https://api.github.com/repos/aframevr/aframe/pulls/2939","id":134516000,"html_url":"https://github.com/aframevr/aframe/pull/2939","diff_url":"https://github.com/aframevr/aframe/pull/2939.diff","patch_url":"https://github.com/aframevr/aframe/pull/2939.patch","issue_url":"https://api.github.com/repos/aframevr/aframe/issues/2939","number":2939,"state":"open","locked":false,"title":"Prevent cloning objects into previousData that are not plain objects","user":{"login":"dmarcos","id":39342,"avatar_url":"https://avatars3.githubusercontent.com/u/39342?v=4","gravatar_id":"","url":"https://api.github.com/users/dmarcos","html_url":"https://github.com/dmarcos","followers_url":"https://api.github.com/users/dmarcos/followers","following_url":"https://api.github.com/users/dmarcos/following{/other_user}","gists_url":"https://api.github.com/users/dmarcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcos/subscriptions","organizations_url":"https://api.github.com/users/dmarcos/orgs","repos_url":"https://api.github.com/users/dmarcos/repos","events_url":"https://api.github.com/users/dmarcos/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcos/received_events","type":"User","site_admin":false},"body":"`a-saturday-night` uses `selector` properties that change at run time. This triggered `Converted circular structure to JSON` errors when trying to clone into previousData A-Frame entity elements that hold references to other A-Frame entities via components .We should only be cloning plain objects.","created_at":"2017-08-07T20:06:55Z","updated_at":"2017-08-08T06:50:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bd97de75a524c357d530ada7a456f9e779a05567","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/aframevr/aframe/pulls/2939/commits","review_comments_url":"https://api.github.com/repos/aframevr/aframe/pulls/2939/comments","review_comment_url":"https://api.github.com/repos/aframevr/aframe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aframevr/aframe/issues/2939/comments","statuses_url":"https://api.github.com/repos/aframevr/aframe/statuses/2bd9451095e4dc0c30a8599007f7c8574ef4aff6","head":{"label":"dmarcos:avoidCloningNonObjects","ref":"avoidCloningNonObjects","sha":"2bd9451095e4dc0c30a8599007f7c8574ef4aff6","user":{"login":"dmarcos","id":39342,"avatar_url":"https://avatars3.githubusercontent.com/u/39342?v=4","gravatar_id":"","url":"https://api.github.com/users/dmarcos","html_url":"https://github.com/dmarcos","followers_url":"https://api.github.com/users/dmarcos/followers","following_url":"https://api.github.com/users/dmarcos/following{/other_user}","gists_url":"https://api.github.com/users/dmarcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcos/subscriptions","organizations_url":"https://api.github.com/users/dmarcos/orgs","repos_url":"https://api.github.com/users/dmarcos/repos","events_url":"https://api.github.com/users/dmarcos/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcos/received_events","type":"User","site_admin":false},"repo":{"id":49595885,"name":"aframe","full_name":"dmarcos/aframe","owner":{"login":"dmarcos","id":39342,"avatar_url":"https://avatars3.githubusercontent.com/u/39342?v=4","gravatar_id":"","url":"https://api.github.com/users/dmarcos","html_url":"https://github.com/dmarcos","followers_url":"https://api.github.com/users/dmarcos/followers","following_url":"https://api.github.com/users/dmarcos/following{/other_user}","gists_url":"https://api.github.com/users/dmarcos/gists{/gist_id}","starred_url":"https://api.github.com/users/dmarcos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dmarcos/subscriptions","organizations_url":"https://api.github.com/users/dmarcos/orgs","repos_url":"https://api.github.com/users/dmarcos/repos","events_url":"https://api.github.com/users/dmarcos/events{/privacy}","received_events_url":"https://api.github.com/users/dmarcos/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dmarcos/aframe","description":"Building Blocks for the VR Web","fork":true,"url":"https://api.github.com/repos/dmarcos/aframe","forks_url":"https://api.github.com/repos/dmarcos/aframe/forks","keys_url":"https://api.github.com/repos/dmarcos/aframe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dmarcos/aframe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dmarcos/aframe/teams","hooks_url":"https://api.github.com/repos/dmarcos/aframe/hooks","issue_events_url":"https://api.github.com/repos/dmarcos/aframe/issues/events{/number}","events_url":"https://api.github.com/repos/dmarcos/aframe/events","assignees_url":"https://api.github.com/repos/dmarcos/aframe/assignees{/user}","branches_url":"https://api.github.com/repos/dmarcos/aframe/branches{/branch}","tags_url":"https://api.github.com/repos/dmarcos/aframe/tags","blobs_url":"https://api.github.com/repos/dmarcos/aframe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dmarcos/aframe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dmarcos/aframe/git/refs{/sha}","trees_url":"https://api.github.com/repos/dmarcos/aframe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dmarcos/aframe/statuses/{sha}","languages_url":"https://api.github.com/repos/dmarcos/aframe/languages","stargazers_url":"https://api.github.com/repos/dmarcos/aframe/stargazers","contributors_url":"https://api.github.com/repos/dmarcos/aframe/contributors","subscribers_url":"https://api.github.com/repos/dmarcos/aframe/subscribers","subscription_url":"https://api.github.com/repos/dmarcos/aframe/subscription","commits_url":"https://api.github.com/repos/dmarcos/aframe/commits{/sha}","git_commits_url":"https://api.github.com/repos/dmarcos/aframe/git/commits{/sha}","comments_url":"https://api.github.com/repos/dmarcos/aframe/comments{/number}","issue_comment_url":"https://api.github.com/repos/dmarcos/aframe/issues/comments{/number}","contents_url":"https://api.github.com/repos/dmarcos/aframe/contents/{+path}","compare_url":"https://api.github.com/repos/dmarcos/aframe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dmarcos/aframe/merges","archive_url":"https://api.github.com/repos/dmarcos/aframe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dmarcos/aframe/downloads","issues_url":"https://api.github.com/repos/dmarcos/aframe/issues{/number}","pulls_url":"https://api.github.com/repos/dmarcos/aframe/pulls{/number}","milestones_url":"https://api.github.com/repos/dmarcos/aframe/milestones{/number}","notifications_url":"https://api.github.com/repos/dmarcos/aframe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dmarcos/aframe/labels{/name}","releases_url":"https://api.github.com/repos/dmarcos/aframe/releases{/id}","deployments_url":"https://api.github.com/repos/dmarcos/aframe/deployments","created_at":"2016-01-13T19:17:26Z","updated_at":"2017-02-08T03:07:32Z","pushed_at":"2017-08-08T04:26:08Z","git_url":"git://github.com/dmarcos/aframe.git","ssh_url":"git@github.com:dmarcos/aframe.git","clone_url":"https://github.com/dmarcos/aframe.git","svn_url":"https://github.com/dmarcos/aframe","homepage":"https://aframe.io/","size":178285,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"aframevr:master","ref":"master","sha":"06492d7598b7ce67d4399f0cd2dc5d2f00a15787","user":{"login":"aframevr","id":16024092,"avatar_url":"https://avatars0.githubusercontent.com/u/16024092?v=4","gravatar_id":"","url":"https://api.github.com/users/aframevr","html_url":"https://github.com/aframevr","followers_url":"https://api.github.com/users/aframevr/followers","following_url":"https://api.github.com/users/aframevr/following{/other_user}","gists_url":"https://api.github.com/users/aframevr/gists{/gist_id}","starred_url":"https://api.github.com/users/aframevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aframevr/subscriptions","organizations_url":"https://api.github.com/users/aframevr/orgs","repos_url":"https://api.github.com/users/aframevr/repos","events_url":"https://api.github.com/users/aframevr/events{/privacy}","received_events_url":"https://api.github.com/users/aframevr/received_events","type":"Organization","site_admin":false},"repo":{"id":42488903,"name":"aframe","full_name":"aframevr/aframe","owner":{"login":"aframevr","id":16024092,"avatar_url":"https://avatars0.githubusercontent.com/u/16024092?v=4","gravatar_id":"","url":"https://api.github.com/users/aframevr","html_url":"https://github.com/aframevr","followers_url":"https://api.github.com/users/aframevr/followers","following_url":"https://api.github.com/users/aframevr/following{/other_user}","gists_url":"https://api.github.com/users/aframevr/gists{/gist_id}","starred_url":"https://api.github.com/users/aframevr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aframevr/subscriptions","organizations_url":"https://api.github.com/users/aframevr/orgs","repos_url":"https://api.github.com/users/aframevr/repos","events_url":"https://api.github.com/users/aframevr/events{/privacy}","received_events_url":"https://api.github.com/users/aframevr/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aframevr/aframe","description":":a: web framework for building virtual reality experiences.","fork":false,"url":"https://api.github.com/repos/aframevr/aframe","forks_url":"https://api.github.com/repos/aframevr/aframe/forks","keys_url":"https://api.github.com/repos/aframevr/aframe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aframevr/aframe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aframevr/aframe/teams","hooks_url":"https://api.github.com/repos/aframevr/aframe/hooks","issue_events_url":"https://api.github.com/repos/aframevr/aframe/issues/events{/number}","events_url":"https://api.github.com/repos/aframevr/aframe/events","assignees_url":"https://api.github.com/repos/aframevr/aframe/assignees{/user}","branches_url":"https://api.github.com/repos/aframevr/aframe/branches{/branch}","tags_url":"https://api.github.com/repos/aframevr/aframe/tags","blobs_url":"https://api.github.com/repos/aframevr/aframe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aframevr/aframe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aframevr/aframe/git/refs{/sha}","trees_url":"https://api.github.com/repos/aframevr/aframe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aframevr/aframe/statuses/{sha}","languages_url":"https://api.github.com/repos/aframevr/aframe/languages","stargazers_url":"https://api.github.com/repos/aframevr/aframe/stargazers","contributors_url":"https://api.github.com/repos/aframevr/aframe/contributors","subscribers_url":"https://api.github.com/repos/aframevr/aframe/subscribers","subscription_url":"https://api.github.com/repos/aframevr/aframe/subscription","commits_url":"https://api.github.com/repos/aframevr/aframe/commits{/sha}","git_commits_url":"https://api.github.com/repos/aframevr/aframe/git/commits{/sha}","comments_url":"https://api.github.com/repos/aframevr/aframe/comments{/number}","issue_comment_url":"https://api.github.com/repos/aframevr/aframe/issues/comments{/number}","contents_url":"https://api.github.com/repos/aframevr/aframe/contents/{+path}","compare_url":"https://api.github.com/repos/aframevr/aframe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aframevr/aframe/merges","archive_url":"https://api.github.com/repos/aframevr/aframe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aframevr/aframe/downloads","issues_url":"https://api.github.com/repos/aframevr/aframe/issues{/number}","pulls_url":"https://api.github.com/repos/aframevr/aframe/pulls{/number}","milestones_url":"https://api.github.com/repos/aframevr/aframe/milestones{/number}","notifications_url":"https://api.github.com/repos/aframevr/aframe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aframevr/aframe/labels{/name}","releases_url":"https://api.github.com/repos/aframevr/aframe/releases{/id}","deployments_url":"https://api.github.com/repos/aframevr/aframe/deployments","created_at":"2015-09-15T02:04:40Z","updated_at":"2017-08-08T04:20:40Z","pushed_at":"2017-08-08T06:42:58Z","git_url":"git://github.com/aframevr/aframe.git","ssh_url":"git@github.com:aframevr/aframe.git","clone_url":"https://github.com/aframevr/aframe.git","svn_url":"https://github.com/aframevr/aframe","homepage":"https://aframe.io/","size":195865,"stargazers_count":6117,"watchers_count":6117,"language":"JavaScript","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1319,"mirror_url":null,"open_issues_count":202,"forks":1319,"open_issues":202,"watchers":6117,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/2939"},"html":{"href":"https://github.com/aframevr/aframe/pull/2939"},"issue":{"href":"https://api.github.com/repos/aframevr/aframe/issues/2939"},"comments":{"href":"https://api.github.com/repos/aframevr/aframe/issues/2939/comments"},"review_comments":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/2939/comments"},"review_comment":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aframevr/aframe/pulls/2939/commits"},"statuses":{"href":"https://api.github.com/repos/aframevr/aframe/statuses/2bd9451095e4dc0c30a8599007f7c8574ef4aff6"}}}}
{"actor":{"display_login":"ngokevin"}}