{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/iotjs/pulls/comments/159133071","pull_request_review_id":86039924,"id":159133071,"diff_hunk":"@@ -193,26 +165,24 @@ const Config* iotjs_environment_config(const iotjs_environment_t* env) {\n }\n \n \n-void iotjs_environment_go_state_running_main(iotjs_environment_t* env) {\n-  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);\n-\n-  IOTJS_ASSERT(_this->state == kInitializing);\n-  _this->state = kRunningMain;\n-}\n-\n-\n-void iotjs_environment_go_state_running_loop(iotjs_environment_t* env) {\n-  IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);\n-\n-  IOTJS_ASSERT(_this->state == kRunningMain);\n-  _this->state = kRunningLoop;\n-}\n-\n-\n-void iotjs_environment_go_state_exiting(iotjs_environment_t* env) {\n+void iotjs_environment_set_state(iotjs_environment_t* env, State s) {\n   IOTJS_VALIDATED_STRUCT_METHOD(iotjs_environment_t, env);\n-  IOTJS_ASSERT(_this->state < kExiting);\n-  _this->state = kExiting;\n+  switch (s) {\n+    case kInitializing:","path":"src/iotjs_env.c","position":160,"original_position":160,"commit_id":"e7fb1d11d5cd2134df52b3876a0474b3abb160e0","original_commit_id":"e7fb1d11d5cd2134df52b3876a0474b3abb160e0","user":{"login":"zherczeg","id":2270193,"avatar_url":"https://avatars2.githubusercontent.com/u/2270193?v=4","gravatar_id":"","url":"https://api.github.com/users/zherczeg","html_url":"https://github.com/zherczeg","followers_url":"https://api.github.com/users/zherczeg/followers","following_url":"https://api.github.com/users/zherczeg/following{/other_user}","gists_url":"https://api.github.com/users/zherczeg/gists{/gist_id}","starred_url":"https://api.github.com/users/zherczeg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zherczeg/subscriptions","organizations_url":"https://api.github.com/users/zherczeg/orgs","repos_url":"https://api.github.com/users/zherczeg/repos","events_url":"https://api.github.com/users/zherczeg/events{/privacy}","received_events_url":"https://api.github.com/users/zherczeg/received_events","type":"User","site_admin":false},"body":"Can you switch to initializing from any state?","created_at":"2017-12-31T03:21:43Z","updated_at":"2017-12-31T03:21:43Z","html_url":"https://github.com/Samsung/iotjs/pull/1382#discussion_r159133071","pull_request_url":"https://api.github.com/repos/Samsung/iotjs/pulls/1382","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/comments/159133071"},"html":{"href":"https://github.com/Samsung/iotjs/pull/1382#discussion_r159133071"},"pull_request":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1382"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/iotjs/pulls/1382","id":160182419,"html_url":"https://github.com/Samsung/iotjs/pull/1382","diff_url":"https://github.com/Samsung/iotjs/pull/1382.diff","patch_url":"https://github.com/Samsung/iotjs/pull/1382.patch","issue_url":"https://api.github.com/repos/Samsung/iotjs/issues/1382","number":1382,"state":"open","locked":false,"title":"Gardening: iotjs_env, iotjs.c, and iotjs_debuglog","user":{"login":"glistening","id":12553213,"avatar_url":"https://avatars2.githubusercontent.com/u/12553213?v=4","gravatar_id":"","url":"https://api.github.com/users/glistening","html_url":"https://github.com/glistening","followers_url":"https://api.github.com/users/glistening/followers","following_url":"https://api.github.com/users/glistening/following{/other_user}","gists_url":"https://api.github.com/users/glistening/gists{/gist_id}","starred_url":"https://api.github.com/users/glistening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glistening/subscriptions","organizations_url":"https://api.github.com/users/glistening/orgs","repos_url":"https://api.github.com/users/glistening/repos","events_url":"https://api.github.com/users/glistening/events{/privacy}","received_events_url":"https://api.github.com/users/glistening/received_events","type":"User","site_admin":false},"body":"This PR is mainly for enhancing readability.\r\n\r\n- Make consistent use of style for function naming\r\n- Make logic simple\r\n- Remove several unnecessaries\r\n(clonning argv, comments that say the function name again, ...)\r\n\r\nIoT.js-DCO-1.0-Signed-off-by: Sanggyu Lee sg5.lee@samsung.com","created_at":"2017-12-27T01:44:02Z","updated_at":"2017-12-31T03:21:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e775a5389e50a8e9ce408be2ff70e27d299e4545","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/iotjs/pulls/1382/commits","review_comments_url":"https://api.github.com/repos/Samsung/iotjs/pulls/1382/comments","review_comment_url":"https://api.github.com/repos/Samsung/iotjs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/iotjs/issues/1382/comments","statuses_url":"https://api.github.com/repos/Samsung/iotjs/statuses/e7fb1d11d5cd2134df52b3876a0474b3abb160e0","head":{"label":"glistening:gardening_iotjs_env","ref":"gardening_iotjs_env","sha":"e7fb1d11d5cd2134df52b3876a0474b3abb160e0","user":{"login":"glistening","id":12553213,"avatar_url":"https://avatars2.githubusercontent.com/u/12553213?v=4","gravatar_id":"","url":"https://api.github.com/users/glistening","html_url":"https://github.com/glistening","followers_url":"https://api.github.com/users/glistening/followers","following_url":"https://api.github.com/users/glistening/following{/other_user}","gists_url":"https://api.github.com/users/glistening/gists{/gist_id}","starred_url":"https://api.github.com/users/glistening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glistening/subscriptions","organizations_url":"https://api.github.com/users/glistening/orgs","repos_url":"https://api.github.com/users/glistening/repos","events_url":"https://api.github.com/users/glistening/events{/privacy}","received_events_url":"https://api.github.com/users/glistening/received_events","type":"User","site_admin":false},"repo":{"id":68057380,"name":"iotjs","full_name":"glistening/iotjs","owner":{"login":"glistening","id":12553213,"avatar_url":"https://avatars2.githubusercontent.com/u/12553213?v=4","gravatar_id":"","url":"https://api.github.com/users/glistening","html_url":"https://github.com/glistening","followers_url":"https://api.github.com/users/glistening/followers","following_url":"https://api.github.com/users/glistening/following{/other_user}","gists_url":"https://api.github.com/users/glistening/gists{/gist_id}","starred_url":"https://api.github.com/users/glistening/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glistening/subscriptions","organizations_url":"https://api.github.com/users/glistening/orgs","repos_url":"https://api.github.com/users/glistening/repos","events_url":"https://api.github.com/users/glistening/events{/privacy}","received_events_url":"https://api.github.com/users/glistening/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/glistening/iotjs","description":"Platform for Internet of Things with JavaScript http://www.iotjs.net ","fork":true,"url":"https://api.github.com/repos/glistening/iotjs","forks_url":"https://api.github.com/repos/glistening/iotjs/forks","keys_url":"https://api.github.com/repos/glistening/iotjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glistening/iotjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glistening/iotjs/teams","hooks_url":"https://api.github.com/repos/glistening/iotjs/hooks","issue_events_url":"https://api.github.com/repos/glistening/iotjs/issues/events{/number}","events_url":"https://api.github.com/repos/glistening/iotjs/events","assignees_url":"https://api.github.com/repos/glistening/iotjs/assignees{/user}","branches_url":"https://api.github.com/repos/glistening/iotjs/branches{/branch}","tags_url":"https://api.github.com/repos/glistening/iotjs/tags","blobs_url":"https://api.github.com/repos/glistening/iotjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glistening/iotjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glistening/iotjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/glistening/iotjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glistening/iotjs/statuses/{sha}","languages_url":"https://api.github.com/repos/glistening/iotjs/languages","stargazers_url":"https://api.github.com/repos/glistening/iotjs/stargazers","contributors_url":"https://api.github.com/repos/glistening/iotjs/contributors","subscribers_url":"https://api.github.com/repos/glistening/iotjs/subscribers","subscription_url":"https://api.github.com/repos/glistening/iotjs/subscription","commits_url":"https://api.github.com/repos/glistening/iotjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/glistening/iotjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/glistening/iotjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/glistening/iotjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/glistening/iotjs/contents/{+path}","compare_url":"https://api.github.com/repos/glistening/iotjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glistening/iotjs/merges","archive_url":"https://api.github.com/repos/glistening/iotjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glistening/iotjs/downloads","issues_url":"https://api.github.com/repos/glistening/iotjs/issues{/number}","pulls_url":"https://api.github.com/repos/glistening/iotjs/pulls{/number}","milestones_url":"https://api.github.com/repos/glistening/iotjs/milestones{/number}","notifications_url":"https://api.github.com/repos/glistening/iotjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glistening/iotjs/labels{/name}","releases_url":"https://api.github.com/repos/glistening/iotjs/releases{/id}","deployments_url":"https://api.github.com/repos/glistening/iotjs/deployments","created_at":"2016-09-12T23:50:23Z","updated_at":"2017-05-11T10:35:15Z","pushed_at":"2017-12-27T04:18:10Z","git_url":"git://github.com/glistening/iotjs.git","ssh_url":"git@github.com:glistening/iotjs.git","clone_url":"https://github.com/glistening/iotjs.git","svn_url":"https://github.com/glistening/iotjs","homepage":"","size":5302,"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,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Samsung:master","ref":"master","sha":"d2842115147525a4e82e63cf4d847282ae999eab","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars3.githubusercontent.com/u/6210390?v=4","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"repo":{"id":33589470,"name":"iotjs","full_name":"Samsung/iotjs","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars3.githubusercontent.com/u/6210390?v=4","gravatar_id":"","url":"https://api.github.com/users/Samsung","html_url":"https://github.com/Samsung","followers_url":"https://api.github.com/users/Samsung/followers","following_url":"https://api.github.com/users/Samsung/following{/other_user}","gists_url":"https://api.github.com/users/Samsung/gists{/gist_id}","starred_url":"https://api.github.com/users/Samsung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Samsung/subscriptions","organizations_url":"https://api.github.com/users/Samsung/orgs","repos_url":"https://api.github.com/users/Samsung/repos","events_url":"https://api.github.com/users/Samsung/events{/privacy}","received_events_url":"https://api.github.com/users/Samsung/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Samsung/iotjs","description":"Platform for Internet of Things with JavaScript http://www.iotjs.net ","fork":false,"url":"https://api.github.com/repos/Samsung/iotjs","forks_url":"https://api.github.com/repos/Samsung/iotjs/forks","keys_url":"https://api.github.com/repos/Samsung/iotjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/iotjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/iotjs/teams","hooks_url":"https://api.github.com/repos/Samsung/iotjs/hooks","issue_events_url":"https://api.github.com/repos/Samsung/iotjs/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/iotjs/events","assignees_url":"https://api.github.com/repos/Samsung/iotjs/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/iotjs/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/iotjs/tags","blobs_url":"https://api.github.com/repos/Samsung/iotjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/iotjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/iotjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/iotjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/iotjs/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/iotjs/languages","stargazers_url":"https://api.github.com/repos/Samsung/iotjs/stargazers","contributors_url":"https://api.github.com/repos/Samsung/iotjs/contributors","subscribers_url":"https://api.github.com/repos/Samsung/iotjs/subscribers","subscription_url":"https://api.github.com/repos/Samsung/iotjs/subscription","commits_url":"https://api.github.com/repos/Samsung/iotjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/iotjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/iotjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/iotjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/iotjs/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/iotjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/iotjs/merges","archive_url":"https://api.github.com/repos/Samsung/iotjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/iotjs/downloads","issues_url":"https://api.github.com/repos/Samsung/iotjs/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/iotjs/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/iotjs/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/iotjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/iotjs/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/iotjs/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/iotjs/deployments","created_at":"2015-04-08T06:41:39Z","updated_at":"2017-12-31T01:51:08Z","pushed_at":"2017-12-27T04:18:11Z","git_url":"git://github.com/Samsung/iotjs.git","ssh_url":"git@github.com:Samsung/iotjs.git","clone_url":"https://github.com/Samsung/iotjs.git","svn_url":"https://github.com/Samsung/iotjs","homepage":"","size":63424,"stargazers_count":1515,"watchers_count":1515,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":286,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"ecl-2.0","name":"Educational Community License v2.0","spdx_id":"ECL-2.0","url":"https://api.github.com/licenses/ecl-2.0"},"forks":286,"open_issues":43,"watchers":1515,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1382"},"html":{"href":"https://github.com/Samsung/iotjs/pull/1382"},"issue":{"href":"https://api.github.com/repos/Samsung/iotjs/issues/1382"},"comments":{"href":"https://api.github.com/repos/Samsung/iotjs/issues/1382/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1382/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/iotjs/pulls/1382/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/iotjs/statuses/e7fb1d11d5cd2134df52b3876a0474b3abb160e0"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"zherczeg"}}