{"action":"created","comment":{"url":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/comments/114967233","pull_request_review_id":36473855,"id":114967233,"diff_hunk":"@@ -0,0 +1,43 @@\n+/* Copyright JS Foundation and other contributors, http://js.foundation\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *     http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+#include \"jerryscript-ext/external.h\"\n+\n+\n+/**\n+ * Register a JavaScript function in the global object.\n+ *\n+ * Note:\n+ *      returned value must be freed with jerry_release_value, when it is no longer needed.\n+ *\n+ * @return true value - if the operation was successful\n+ *         value marked with error flag - otherwise\n+ */\n+jerry_value_t\n+jerryx_external_register_global_function (const jerry_char_t *name_p, /**< name of the function */","path":"jerry-ext/external/external-register.c","position":29,"original_position":29,"commit_id":"2fc41a3346410b055000603c0861f6e3b7bbf3bd","original_commit_id":"77d14a4e5ede6bba7c426cbe8f0ab9bb6b50fa29","user":{"login":"akosthekiss","id":9976482,"avatar_url":"https://avatars3.githubusercontent.com/u/9976482?v=3","gravatar_id":"","url":"https://api.github.com/users/akosthekiss","html_url":"https://github.com/akosthekiss","followers_url":"https://api.github.com/users/akosthekiss/followers","following_url":"https://api.github.com/users/akosthekiss/following{/other_user}","gists_url":"https://api.github.com/users/akosthekiss/gists{/gist_id}","starred_url":"https://api.github.com/users/akosthekiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akosthekiss/subscriptions","organizations_url":"https://api.github.com/users/akosthekiss/orgs","repos_url":"https://api.github.com/users/akosthekiss/repos","events_url":"https://api.github.com/users/akosthekiss/events{/privacy}","received_events_url":"https://api.github.com/users/akosthekiss/received_events","type":"User","site_admin":false},"body":"I'm against \"builtin\": builtin is something that's built in. These functions are not. They are external. The term \"external builtin\" is self-contradictory.\r\n\r\nBut I'm also against polluting the \"global namespace\" of jerry-ext with each and every function. We should keep the concept of \"modules\" or \"sub-libraries\" within jerry-ext. The currently proposed one is to deal with (common) external functions.","created_at":"2017-05-05T10:15:05Z","updated_at":"2017-05-05T10:15:05Z","html_url":"https://github.com/jerryscript-project/jerryscript/pull/1787#discussion_r114967233","pull_request_url":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787","_links":{"self":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/comments/114967233"},"html":{"href":"https://github.com/jerryscript-project/jerryscript/pull/1787#discussion_r114967233"},"pull_request":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787"}}},"pull_request":{"url":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787","id":117782296,"html_url":"https://github.com/jerryscript-project/jerryscript/pull/1787","diff_url":"https://github.com/jerryscript-project/jerryscript/pull/1787.diff","patch_url":"https://github.com/jerryscript-project/jerryscript/pull/1787.patch","issue_url":"https://api.github.com/repos/jerryscript-project/jerryscript/issues/1787","number":1787,"state":"open","locked":false,"title":"Common but non-standard JS function implementations in jerry-ext","user":{"login":"akosthekiss","id":9976482,"avatar_url":"https://avatars3.githubusercontent.com/u/9976482?v=3","gravatar_id":"","url":"https://api.github.com/users/akosthekiss","html_url":"https://github.com/akosthekiss","followers_url":"https://api.github.com/users/akosthekiss/followers","following_url":"https://api.github.com/users/akosthekiss/following{/other_user}","gists_url":"https://api.github.com/users/akosthekiss/gists{/gist_id}","starred_url":"https://api.github.com/users/akosthekiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akosthekiss/subscriptions","organizations_url":"https://api.github.com/users/akosthekiss/orgs","repos_url":"https://api.github.com/users/akosthekiss/repos","events_url":"https://api.github.com/users/akosthekiss/events{/privacy}","received_events_url":"https://api.github.com/users/akosthekiss/received_events","type":"User","site_admin":false},"body":"This PR splits out the implementation of \"common but non-standard\" functions\r\nfrom PR #1749. The goal is to save various targets from re-implementing external\r\nfunction handlers for `print`, `gc`, or `assert`. The idea is to provide these\r\nhandlers as a module of the now-forming `jerry-ext` library.\r\n\r\nThe PR is still Work in Progress, because\r\n\r\n- there is a debate whether all function handlers should be in one module (i.e.,\r\n  source sub-directory) of `jerry-ext`, or each should go into its own subdir,\r\n\r\n- there is no consensus what would be a good name for the module(s),\r\n\r\n- I'm not sure how `print` could be implemented in the most portable but also\r\n  efficient way (because a reusable implementation cannot rely on libc's\r\n  `printf` -- but then each port/app must somehow provide its own C-level\r\n  printing routine, which we are just getting rid of in #1749...), and\r\n\r\n- `jerry-ext` is not in master yet, so there is no build system, CMakeLists,\r\n  etc. in this PR.\r\n\r\nNote: we can also conclude that such an approach as presented here actually does not add much to reusability, because ports will not share these implementations, e.g., because they have seriously different needs for `assert` or `print`. Please, give your feedback, maintainers of `targets` are especially summoned.","created_at":"2017-04-26T18:39:35Z","updated_at":"2017-05-05T10:15:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f7bbb84751991dfd91aeb49d660d549e0a8963b7","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787/commits","review_comments_url":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787/comments","review_comment_url":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jerryscript-project/jerryscript/issues/1787/comments","statuses_url":"https://api.github.com/repos/jerryscript-project/jerryscript/statuses/2fc41a3346410b055000603c0861f6e3b7bbf3bd","head":{"label":"akosthekiss:jerryx-extfunc","ref":"jerryx-extfunc","sha":"2fc41a3346410b055000603c0861f6e3b7bbf3bd","user":{"login":"akosthekiss","id":9976482,"avatar_url":"https://avatars3.githubusercontent.com/u/9976482?v=3","gravatar_id":"","url":"https://api.github.com/users/akosthekiss","html_url":"https://github.com/akosthekiss","followers_url":"https://api.github.com/users/akosthekiss/followers","following_url":"https://api.github.com/users/akosthekiss/following{/other_user}","gists_url":"https://api.github.com/users/akosthekiss/gists{/gist_id}","starred_url":"https://api.github.com/users/akosthekiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akosthekiss/subscriptions","organizations_url":"https://api.github.com/users/akosthekiss/orgs","repos_url":"https://api.github.com/users/akosthekiss/repos","events_url":"https://api.github.com/users/akosthekiss/events{/privacy}","received_events_url":"https://api.github.com/users/akosthekiss/received_events","type":"User","site_admin":false},"repo":{"id":39144593,"name":"jerryscript","full_name":"akosthekiss/jerryscript","owner":{"login":"akosthekiss","id":9976482,"avatar_url":"https://avatars3.githubusercontent.com/u/9976482?v=3","gravatar_id":"","url":"https://api.github.com/users/akosthekiss","html_url":"https://github.com/akosthekiss","followers_url":"https://api.github.com/users/akosthekiss/followers","following_url":"https://api.github.com/users/akosthekiss/following{/other_user}","gists_url":"https://api.github.com/users/akosthekiss/gists{/gist_id}","starred_url":"https://api.github.com/users/akosthekiss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akosthekiss/subscriptions","organizations_url":"https://api.github.com/users/akosthekiss/orgs","repos_url":"https://api.github.com/users/akosthekiss/repos","events_url":"https://api.github.com/users/akosthekiss/events{/privacy}","received_events_url":"https://api.github.com/users/akosthekiss/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/akosthekiss/jerryscript","description":null,"fork":true,"url":"https://api.github.com/repos/akosthekiss/jerryscript","forks_url":"https://api.github.com/repos/akosthekiss/jerryscript/forks","keys_url":"https://api.github.com/repos/akosthekiss/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/akosthekiss/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/akosthekiss/jerryscript/teams","hooks_url":"https://api.github.com/repos/akosthekiss/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/akosthekiss/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/akosthekiss/jerryscript/events","assignees_url":"https://api.github.com/repos/akosthekiss/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/akosthekiss/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/akosthekiss/jerryscript/tags","blobs_url":"https://api.github.com/repos/akosthekiss/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/akosthekiss/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/akosthekiss/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/akosthekiss/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/akosthekiss/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/akosthekiss/jerryscript/languages","stargazers_url":"https://api.github.com/repos/akosthekiss/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/akosthekiss/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/akosthekiss/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/akosthekiss/jerryscript/subscription","commits_url":"https://api.github.com/repos/akosthekiss/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/akosthekiss/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/akosthekiss/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/akosthekiss/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/akosthekiss/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/akosthekiss/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/akosthekiss/jerryscript/merges","archive_url":"https://api.github.com/repos/akosthekiss/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/akosthekiss/jerryscript/downloads","issues_url":"https://api.github.com/repos/akosthekiss/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/akosthekiss/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/akosthekiss/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/akosthekiss/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/akosthekiss/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/akosthekiss/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/akosthekiss/jerryscript/deployments","created_at":"2015-07-15T15:25:30Z","updated_at":"2016-02-15T12:02:02Z","pushed_at":"2017-05-04T14:34:30Z","git_url":"git://github.com/akosthekiss/jerryscript.git","ssh_url":"git@github.com:akosthekiss/jerryscript.git","clone_url":"https://github.com/akosthekiss/jerryscript.git","svn_url":"https://github.com/akosthekiss/jerryscript","homepage":null,"size":27648,"stargazers_count":0,"watchers_count":0,"language":"C","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":0,"default_branch":"master"}},"base":{"label":"jerryscript-project:master","ref":"master","sha":"91e976f8c7e0505abef70a8d29abbbd036dcf085","user":{"login":"jerryscript-project","id":23194380,"avatar_url":"https://avatars2.githubusercontent.com/u/23194380?v=3","gravatar_id":"","url":"https://api.github.com/users/jerryscript-project","html_url":"https://github.com/jerryscript-project","followers_url":"https://api.github.com/users/jerryscript-project/followers","following_url":"https://api.github.com/users/jerryscript-project/following{/other_user}","gists_url":"https://api.github.com/users/jerryscript-project/gists{/gist_id}","starred_url":"https://api.github.com/users/jerryscript-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerryscript-project/subscriptions","organizations_url":"https://api.github.com/users/jerryscript-project/orgs","repos_url":"https://api.github.com/users/jerryscript-project/repos","events_url":"https://api.github.com/users/jerryscript-project/events{/privacy}","received_events_url":"https://api.github.com/users/jerryscript-project/received_events","type":"Organization","site_admin":false},"repo":{"id":33339660,"name":"jerryscript","full_name":"jerryscript-project/jerryscript","owner":{"login":"jerryscript-project","id":23194380,"avatar_url":"https://avatars2.githubusercontent.com/u/23194380?v=3","gravatar_id":"","url":"https://api.github.com/users/jerryscript-project","html_url":"https://github.com/jerryscript-project","followers_url":"https://api.github.com/users/jerryscript-project/followers","following_url":"https://api.github.com/users/jerryscript-project/following{/other_user}","gists_url":"https://api.github.com/users/jerryscript-project/gists{/gist_id}","starred_url":"https://api.github.com/users/jerryscript-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerryscript-project/subscriptions","organizations_url":"https://api.github.com/users/jerryscript-project/orgs","repos_url":"https://api.github.com/users/jerryscript-project/repos","events_url":"https://api.github.com/users/jerryscript-project/events{/privacy}","received_events_url":"https://api.github.com/users/jerryscript-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jerryscript-project/jerryscript","description":"Ultra-lightweight JavaScript engine for the Internet of Things.","fork":false,"url":"https://api.github.com/repos/jerryscript-project/jerryscript","forks_url":"https://api.github.com/repos/jerryscript-project/jerryscript/forks","keys_url":"https://api.github.com/repos/jerryscript-project/jerryscript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jerryscript-project/jerryscript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jerryscript-project/jerryscript/teams","hooks_url":"https://api.github.com/repos/jerryscript-project/jerryscript/hooks","issue_events_url":"https://api.github.com/repos/jerryscript-project/jerryscript/issues/events{/number}","events_url":"https://api.github.com/repos/jerryscript-project/jerryscript/events","assignees_url":"https://api.github.com/repos/jerryscript-project/jerryscript/assignees{/user}","branches_url":"https://api.github.com/repos/jerryscript-project/jerryscript/branches{/branch}","tags_url":"https://api.github.com/repos/jerryscript-project/jerryscript/tags","blobs_url":"https://api.github.com/repos/jerryscript-project/jerryscript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jerryscript-project/jerryscript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jerryscript-project/jerryscript/git/refs{/sha}","trees_url":"https://api.github.com/repos/jerryscript-project/jerryscript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jerryscript-project/jerryscript/statuses/{sha}","languages_url":"https://api.github.com/repos/jerryscript-project/jerryscript/languages","stargazers_url":"https://api.github.com/repos/jerryscript-project/jerryscript/stargazers","contributors_url":"https://api.github.com/repos/jerryscript-project/jerryscript/contributors","subscribers_url":"https://api.github.com/repos/jerryscript-project/jerryscript/subscribers","subscription_url":"https://api.github.com/repos/jerryscript-project/jerryscript/subscription","commits_url":"https://api.github.com/repos/jerryscript-project/jerryscript/commits{/sha}","git_commits_url":"https://api.github.com/repos/jerryscript-project/jerryscript/git/commits{/sha}","comments_url":"https://api.github.com/repos/jerryscript-project/jerryscript/comments{/number}","issue_comment_url":"https://api.github.com/repos/jerryscript-project/jerryscript/issues/comments{/number}","contents_url":"https://api.github.com/repos/jerryscript-project/jerryscript/contents/{+path}","compare_url":"https://api.github.com/repos/jerryscript-project/jerryscript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jerryscript-project/jerryscript/merges","archive_url":"https://api.github.com/repos/jerryscript-project/jerryscript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jerryscript-project/jerryscript/downloads","issues_url":"https://api.github.com/repos/jerryscript-project/jerryscript/issues{/number}","pulls_url":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls{/number}","milestones_url":"https://api.github.com/repos/jerryscript-project/jerryscript/milestones{/number}","notifications_url":"https://api.github.com/repos/jerryscript-project/jerryscript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jerryscript-project/jerryscript/labels{/name}","releases_url":"https://api.github.com/repos/jerryscript-project/jerryscript/releases{/id}","deployments_url":"https://api.github.com/repos/jerryscript-project/jerryscript/deployments","created_at":"2015-04-03T01:10:31Z","updated_at":"2017-05-05T07:00:51Z","pushed_at":"2017-05-05T08:50:55Z","git_url":"git://github.com/jerryscript-project/jerryscript.git","ssh_url":"git@github.com:jerryscript-project/jerryscript.git","clone_url":"https://github.com/jerryscript-project/jerryscript.git","svn_url":"https://github.com/jerryscript-project/jerryscript","homepage":"http://jerryscript.net","size":28779,"stargazers_count":2260,"watchers_count":2260,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":259,"mirror_url":null,"open_issues_count":31,"forks":259,"open_issues":31,"watchers":2260,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787"},"html":{"href":"https://github.com/jerryscript-project/jerryscript/pull/1787"},"issue":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/issues/1787"},"comments":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/issues/1787/comments"},"review_comments":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787/comments"},"review_comment":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/pulls/1787/commits"},"statuses":{"href":"https://api.github.com/repos/jerryscript-project/jerryscript/statuses/2fc41a3346410b055000603c0861f6e3b7bbf3bd"}}}}
{"actor":{"display_login":"akosthekiss"}}