{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/55562547","id":55562547,"diff_hunk":"@@ -635,6 +635,24 @@ jerry_api_release_object (jerry_api_object_t *object_p) /**< pointer acquired th\n } /* jerry_api_release_object */\n \n /**\n+ * Acquire specified Jerry API value\n+ */\n+jerry_api_value_t *\n+jerry_api_acquire_value (jerry_api_value_t *value_p) /**< API value */\n+{\n+  jerry_assert_api_available ();\n+\n+  if (value_p->type == JERRY_API_DATA_TYPE_STRING)\n+  {\n+    jerry_api_acquire_string (value_p->u.v_string);\n+  }\n+  else if (value_p->type == JERRY_API_DATA_TYPE_OBJECT)\n+  {\n+    jerry_api_acquire_object (value_p->u.v_object);\n+  }","path":"jerry-core/jerry.c","position":18,"original_position":18,"commit_id":"bf925bd56278c51606ce7c2576804f03b07d0922","original_commit_id":"bf925bd56278c51606ce7c2576804f03b07d0922","user":{"login":"franc0is","id":4192460,"avatar_url":"https://avatars.githubusercontent.com/u/4192460?v=3","gravatar_id":"","url":"https://api.github.com/users/franc0is","html_url":"https://github.com/franc0is","followers_url":"https://api.github.com/users/franc0is/followers","following_url":"https://api.github.com/users/franc0is/following{/other_user}","gists_url":"https://api.github.com/users/franc0is/gists{/gist_id}","starred_url":"https://api.github.com/users/franc0is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franc0is/subscriptions","organizations_url":"https://api.github.com/users/franc0is/orgs","repos_url":"https://api.github.com/users/franc0is/repos","events_url":"https://api.github.com/users/franc0is/events{/privacy}","received_events_url":"https://api.github.com/users/franc0is/received_events","type":"User","site_admin":false},"body":"@akiss77 In my opinion, this is an implementation detail. Perhaps in the future, new data types have acquire/release semantics as well, in which case `jerry_api_acquire_value` and `jerry_api_release_value` should do the right thing. Note that `jerry_api_release_value` does not have an else clause either.","created_at":"2016-03-09T18:16:17Z","updated_at":"2016-03-09T18:16:17Z","html_url":"https://github.com/Samsung/jerryscript/pull/944#discussion_r55562547","pull_request_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/944","_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/55562547"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/944#discussion_r55562547"},"pull_request":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/944"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/944","id":62133899,"html_url":"https://github.com/Samsung/jerryscript/pull/944","diff_url":"https://github.com/Samsung/jerryscript/pull/944.diff","patch_url":"https://github.com/Samsung/jerryscript/pull/944.patch","issue_url":"https://api.github.com/repos/Samsung/jerryscript/issues/944","number":944,"state":"open","locked":false,"title":"Add acquire_value API to simplify caller code","user":{"login":"franc0is","id":4192460,"avatar_url":"https://avatars.githubusercontent.com/u/4192460?v=3","gravatar_id":"","url":"https://api.github.com/users/franc0is","html_url":"https://github.com/franc0is","followers_url":"https://api.github.com/users/franc0is/followers","following_url":"https://api.github.com/users/franc0is/following{/other_user}","gists_url":"https://api.github.com/users/franc0is/gists{/gist_id}","starred_url":"https://api.github.com/users/franc0is/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/franc0is/subscriptions","organizations_url":"https://api.github.com/users/franc0is/orgs","repos_url":"https://api.github.com/users/franc0is/repos","events_url":"https://api.github.com/users/franc0is/events{/privacy}","received_events_url":"https://api.github.com/users/franc0is/received_events","type":"User","site_admin":false},"body":"JerryScript-DCO-1.0-Signed-off-by: François Baldassari francois@pebble.com","created_at":"2016-03-08T20:50:02Z","updated_at":"2016-03-09T18:16:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f517503fa2b3fdf28dd5c602f2bea2bec18ab5d4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/944/commits","review_comments_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/944/comments","review_comment_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/issues/944/comments","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/bf925bd56278c51606ce7c2576804f03b07d0922","head":{"label":"pebble:acquire-value","ref":"acquire-value","sha":"bf925bd56278c51606ce7c2576804f03b07d0922","user":{"login":"pebble","id":1048268,"avatar_url":"https://avatars.githubusercontent.com/u/1048268?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble","html_url":"https://github.com/pebble","followers_url":"https://api.github.com/users/pebble/followers","following_url":"https://api.github.com/users/pebble/following{/other_user}","gists_url":"https://api.github.com/users/pebble/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble/subscriptions","organizations_url":"https://api.github.com/users/pebble/orgs","repos_url":"https://api.github.com/users/pebble/repos","events_url":"https://api.github.com/users/pebble/events{/privacy}","received_events_url":"https://api.github.com/users/pebble/received_events","type":"Organization","site_admin":false},"repo":{"id":51785445,"name":"jerryscript","full_name":"pebble/jerryscript","owner":{"login":"pebble","id":1048268,"avatar_url":"https://avatars.githubusercontent.com/u/1048268?v=3","gravatar_id":"","url":"https://api.github.com/users/pebble","html_url":"https://github.com/pebble","followers_url":"https://api.github.com/users/pebble/followers","following_url":"https://api.github.com/users/pebble/following{/other_user}","gists_url":"https://api.github.com/users/pebble/gists{/gist_id}","starred_url":"https://api.github.com/users/pebble/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pebble/subscriptions","organizations_url":"https://api.github.com/users/pebble/orgs","repos_url":"https://api.github.com/users/pebble/repos","events_url":"https://api.github.com/users/pebble/events{/privacy}","received_events_url":"https://api.github.com/users/pebble/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pebble/jerryscript","description":"Ultra-lightweight JavaScript engine for Internet of Things. http://www.jerryscript.net","fork":true,"url":"https://api.github.com/repos/pebble/jerryscript","forks_url":"https://api.github.com/repos/pebble/jerryscript/forks","keys_url":"https://api.github.com/repos/pebble/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pebble/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pebble/jerryscript/teams","hooks_url":"https://api.github.com/repos/pebble/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/pebble/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/pebble/jerryscript/events","assignees_url":"https://api.github.com/repos/pebble/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/pebble/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/pebble/jerryscript/tags","blobs_url":"https://api.github.com/repos/pebble/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pebble/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pebble/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/pebble/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pebble/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/pebble/jerryscript/languages","stargazers_url":"https://api.github.com/repos/pebble/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/pebble/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/pebble/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/pebble/jerryscript/subscription","commits_url":"https://api.github.com/repos/pebble/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/pebble/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/pebble/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/pebble/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/pebble/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/pebble/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pebble/jerryscript/merges","archive_url":"https://api.github.com/repos/pebble/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pebble/jerryscript/downloads","issues_url":"https://api.github.com/repos/pebble/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/pebble/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/pebble/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/pebble/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pebble/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/pebble/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/pebble/jerryscript/deployments","created_at":"2016-02-15T21:03:28Z","updated_at":"2016-02-15T21:03:31Z","pushed_at":"2016-03-09T18:09:36Z","git_url":"git://github.com/pebble/jerryscript.git","ssh_url":"git@github.com:pebble/jerryscript.git","clone_url":"https://github.com/pebble/jerryscript.git","svn_url":"https://github.com/pebble/jerryscript","homepage":"","size":8569,"stargazers_count":0,"watchers_count":0,"language":"C","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":"Samsung:master","ref":"master","sha":"25b0750756555b2a6cf7f33f9e21974b2b597e6a","user":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","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":33339660,"name":"jerryscript","full_name":"Samsung/jerryscript","owner":{"login":"Samsung","id":6210390,"avatar_url":"https://avatars.githubusercontent.com/u/6210390?v=3","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/jerryscript","description":"Ultra-lightweight JavaScript engine for Internet of Things. http://www.jerryscript.net","fork":false,"url":"https://api.github.com/repos/Samsung/jerryscript","forks_url":"https://api.github.com/repos/Samsung/jerryscript/forks","keys_url":"https://api.github.com/repos/Samsung/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Samsung/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Samsung/jerryscript/teams","hooks_url":"https://api.github.com/repos/Samsung/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/Samsung/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/Samsung/jerryscript/events","assignees_url":"https://api.github.com/repos/Samsung/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/Samsung/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/Samsung/jerryscript/tags","blobs_url":"https://api.github.com/repos/Samsung/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Samsung/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Samsung/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/Samsung/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/Samsung/jerryscript/languages","stargazers_url":"https://api.github.com/repos/Samsung/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/Samsung/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/Samsung/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/Samsung/jerryscript/subscription","commits_url":"https://api.github.com/repos/Samsung/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/Samsung/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/Samsung/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/Samsung/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/Samsung/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Samsung/jerryscript/merges","archive_url":"https://api.github.com/repos/Samsung/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Samsung/jerryscript/downloads","issues_url":"https://api.github.com/repos/Samsung/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/Samsung/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/Samsung/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/Samsung/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Samsung/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/Samsung/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/Samsung/jerryscript/deployments","created_at":"2015-04-03T01:10:31Z","updated_at":"2016-03-09T13:50:47Z","pushed_at":"2016-03-09T18:11:43Z","git_url":"git://github.com/Samsung/jerryscript.git","ssh_url":"git@github.com:Samsung/jerryscript.git","clone_url":"https://github.com/Samsung/jerryscript.git","svn_url":"https://github.com/Samsung/jerryscript","homepage":"","size":10577,"stargazers_count":1186,"watchers_count":1186,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":121,"mirror_url":null,"open_issues_count":56,"forks":121,"open_issues":56,"watchers":1186,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/944"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/944"},"issue":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/944"},"comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/944/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/944/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/944/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/jerryscript/statuses/bf925bd56278c51606ce7c2576804f03b07d0922"}}}}