{"action":"created","comment":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/72936048","id":72936048,"diff_hunk":"@@ -86,41 +87,36 @@ static bool\n register_native_function (const char* name,\n                           jerry_external_handler_t handler)\n {\n-  jerry_api_object_t *global_obj_p;\n-  jerry_api_object_t *reg_func_p;\n-  jerry_api_value_t reg_value;\n-  bool bok;\n-\n-  global_obj_p = jerry_api_get_global ();\n-  reg_func_p = jerry_api_create_external_function (handler);\n-\n-  if (!(reg_func_p != NULL\n-      && jerry_api_is_function (reg_func_p)\n-      && jerry_api_is_constructor (reg_func_p)))\n+  jerry_value_t global_object_val = jerry_get_global_object ();\n+  jerry_value_t reg_function = jerry_create_external_function (handler);\n+  jerry_value_t reg_value = jerry_create_undefined ();\n+  jerry_value_t set_result;\n+\n+  if (!(reg_function != 0\n+      && jerry_value_is_function (reg_function)\n+      && jerry_value_is_constructor (reg_function)))\n   {\n     printf (\"Error: create_external_function failed !!!\\r\\n\");\n-    jerry_api_release_object (global_obj_p);\n-    return false;\n+    jerry_release_value (global_object_val);\n+    return jerry_create_boolean (false);\n   }\n \n-  jerry_api_acquire_object (reg_func_p);\n-  reg_value.type = JERRY_API_DATA_TYPE_OBJECT;\n-  reg_value.u.v_object = reg_func_p;\n+  jerry_value_t jerry_name = jerry_create_string((jerry_char_t*) name);\n \n-  bok = jerry_api_set_object_field_value (global_obj_p,\n-                                          (jerry_api_char_t *) name,\n-                                          &reg_value);\n+  set_result = jerry_set_property (global_object_val,\n+                                   jerry_name,\n+                                   reg_value);\n \n-  jerry_api_release_value (&reg_value);\n-  jerry_api_release_object (reg_func_p);\n-  jerry_api_release_object (global_obj_p);\n+  jerry_release_value (reg_value);\n+  jerry_release_value (global_object_val);\n+  jerry_release_value (jerry_name);\n \n-  if (!bok)\n+  if (!set_result)\n   {\n     printf (\"Error: register_native_function failed: [%s]\\r\\n\", name);\n   }\n \n-  return bok;\n+  return set_result;","path":"targets/mbed/source/jerry_extapi.cpp","position":146,"original_position":146,"commit_id":"4b1eb6fe0aa80bfe8738c55c43030f455c4a7dec","original_commit_id":"4b1eb6fe0aa80bfe8738c55c43030f455c4a7dec","user":{"login":"LaszloLango","id":10030017,"avatar_url":"https://avatars.githubusercontent.com/u/10030017?v=3","gravatar_id":"","url":"https://api.github.com/users/LaszloLango","html_url":"https://github.com/LaszloLango","followers_url":"https://api.github.com/users/LaszloLango/followers","following_url":"https://api.github.com/users/LaszloLango/following{/other_user}","gists_url":"https://api.github.com/users/LaszloLango/gists{/gist_id}","starred_url":"https://api.github.com/users/LaszloLango/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LaszloLango/subscriptions","organizations_url":"https://api.github.com/users/LaszloLango/orgs","repos_url":"https://api.github.com/users/LaszloLango/repos","events_url":"https://api.github.com/users/LaszloLango/events{/privacy}","received_events_url":"https://api.github.com/users/LaszloLango/received_events","type":"User","site_admin":false},"body":"```c\r\njerry_release_value (set_result);\r\nreturn true;\r\n```","created_at":"2016-08-01T07:51:45Z","updated_at":"2016-08-01T07:51:45Z","html_url":"https://github.com/Samsung/jerryscript/pull/1175#discussion_r72936048","pull_request_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175","_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments/72936048"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/1175#discussion_r72936048"},"pull_request":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175"}}},"pull_request":{"url":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175","id":75780369,"html_url":"https://github.com/Samsung/jerryscript/pull/1175","diff_url":"https://github.com/Samsung/jerryscript/pull/1175.diff","patch_url":"https://github.com/Samsung/jerryscript/pull/1175.patch","issue_url":"https://api.github.com/repos/Samsung/jerryscript/issues/1175","number":1175,"state":"open","locked":false,"title":"Update the API changes in mbed targets","user":{"login":"polaroi8d","id":9247788,"avatar_url":"https://avatars.githubusercontent.com/u/9247788?v=3","gravatar_id":"","url":"https://api.github.com/users/polaroi8d","html_url":"https://github.com/polaroi8d","followers_url":"https://api.github.com/users/polaroi8d/followers","following_url":"https://api.github.com/users/polaroi8d/following{/other_user}","gists_url":"https://api.github.com/users/polaroi8d/gists{/gist_id}","starred_url":"https://api.github.com/users/polaroi8d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polaroi8d/subscriptions","organizations_url":"https://api.github.com/users/polaroi8d/orgs","repos_url":"https://api.github.com/users/polaroi8d/repos","events_url":"https://api.github.com/users/polaroi8d/events{/privacy}","received_events_url":"https://api.github.com/users/polaroi8d/received_events","type":"User","site_admin":false},"body":"Updating the ports because the API of JerryScript has been changed recently.","created_at":"2016-06-30T08:40:40Z","updated_at":"2016-08-01T07:51:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"22bf170ab40c453f0f0b428394e927a435864170","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175/commits","review_comments_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175/comments","review_comment_url":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Samsung/jerryscript/issues/1175/comments","statuses_url":"https://api.github.com/repos/Samsung/jerryscript/statuses/4b1eb6fe0aa80bfe8738c55c43030f455c4a7dec","head":{"label":"polaroi8d:api_changes","ref":"api_changes","sha":"4b1eb6fe0aa80bfe8738c55c43030f455c4a7dec","user":{"login":"polaroi8d","id":9247788,"avatar_url":"https://avatars.githubusercontent.com/u/9247788?v=3","gravatar_id":"","url":"https://api.github.com/users/polaroi8d","html_url":"https://github.com/polaroi8d","followers_url":"https://api.github.com/users/polaroi8d/followers","following_url":"https://api.github.com/users/polaroi8d/following{/other_user}","gists_url":"https://api.github.com/users/polaroi8d/gists{/gist_id}","starred_url":"https://api.github.com/users/polaroi8d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polaroi8d/subscriptions","organizations_url":"https://api.github.com/users/polaroi8d/orgs","repos_url":"https://api.github.com/users/polaroi8d/repos","events_url":"https://api.github.com/users/polaroi8d/events{/privacy}","received_events_url":"https://api.github.com/users/polaroi8d/received_events","type":"User","site_admin":false},"repo":{"id":61634564,"name":"jerryscript","full_name":"polaroi8d/jerryscript","owner":{"login":"polaroi8d","id":9247788,"avatar_url":"https://avatars.githubusercontent.com/u/9247788?v=3","gravatar_id":"","url":"https://api.github.com/users/polaroi8d","html_url":"https://github.com/polaroi8d","followers_url":"https://api.github.com/users/polaroi8d/followers","following_url":"https://api.github.com/users/polaroi8d/following{/other_user}","gists_url":"https://api.github.com/users/polaroi8d/gists{/gist_id}","starred_url":"https://api.github.com/users/polaroi8d/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/polaroi8d/subscriptions","organizations_url":"https://api.github.com/users/polaroi8d/orgs","repos_url":"https://api.github.com/users/polaroi8d/repos","events_url":"https://api.github.com/users/polaroi8d/events{/privacy}","received_events_url":"https://api.github.com/users/polaroi8d/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/polaroi8d/jerryscript","description":"Ultra-lightweight JavaScript engine for the Internet of Things. http://samsung.github.io/jerryscript","fork":true,"url":"https://api.github.com/repos/polaroi8d/jerryscript","forks_url":"https://api.github.com/repos/polaroi8d/jerryscript/forks","keys_url":"https://api.github.com/repos/polaroi8d/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/polaroi8d/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/polaroi8d/jerryscript/teams","hooks_url":"https://api.github.com/repos/polaroi8d/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/polaroi8d/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/polaroi8d/jerryscript/events","assignees_url":"https://api.github.com/repos/polaroi8d/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/polaroi8d/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/polaroi8d/jerryscript/tags","blobs_url":"https://api.github.com/repos/polaroi8d/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/polaroi8d/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/polaroi8d/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/polaroi8d/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/polaroi8d/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/polaroi8d/jerryscript/languages","stargazers_url":"https://api.github.com/repos/polaroi8d/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/polaroi8d/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/polaroi8d/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/polaroi8d/jerryscript/subscription","commits_url":"https://api.github.com/repos/polaroi8d/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/polaroi8d/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/polaroi8d/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/polaroi8d/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/polaroi8d/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/polaroi8d/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/polaroi8d/jerryscript/merges","archive_url":"https://api.github.com/repos/polaroi8d/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/polaroi8d/jerryscript/downloads","issues_url":"https://api.github.com/repos/polaroi8d/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/polaroi8d/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/polaroi8d/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/polaroi8d/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/polaroi8d/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/polaroi8d/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/polaroi8d/jerryscript/deployments","created_at":"2016-06-21T13:07:27Z","updated_at":"2016-06-21T13:07:31Z","pushed_at":"2016-07-29T11:50:55Z","git_url":"git://github.com/polaroi8d/jerryscript.git","ssh_url":"git@github.com:polaroi8d/jerryscript.git","clone_url":"https://github.com/polaroi8d/jerryscript.git","svn_url":"https://github.com/polaroi8d/jerryscript","homepage":"","size":24841,"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":"15ba287b9e58b3c161b20fa00dc84f1fe904bfec","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 the Internet of Things. http://samsung.github.io/jerryscript","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-07-29T16:11:39Z","pushed_at":"2016-08-01T07:38:18Z","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":26996,"stargazers_count":1380,"watchers_count":1380,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":159,"mirror_url":null,"open_issues_count":41,"forks":159,"open_issues":41,"watchers":1380,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175"},"html":{"href":"https://github.com/Samsung/jerryscript/pull/1175"},"issue":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/1175"},"comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/issues/1175/comments"},"review_comments":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175/comments"},"review_comment":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Samsung/jerryscript/pulls/1175/commits"},"statuses":{"href":"https://api.github.com/repos/Samsung/jerryscript/statuses/4b1eb6fe0aa80bfe8738c55c43030f455c4a7dec"}}}}
{"actor":{"display_login":"LaszloLango"}}