{"action":"closed","number":781,"pull_request":{"url":"https://api.github.com/repos/svaarala/duktape/pulls/781","id":70067973,"html_url":"https://github.com/svaarala/duktape/pull/781","diff_url":"https://github.com/svaarala/duktape/pull/781.diff","patch_url":"https://github.com/svaarala/duktape/pull/781.patch","issue_url":"https://api.github.com/repos/svaarala/duktape/issues/781","number":781,"state":"closed","locked":false,"title":"Remove fatal/panic distinction and use fatal errors only","user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"body":"Remove the Duktape 1.x distinction between fatal errors and panic errors which had different handling paths. The main difference between these two was that fatal errors went through a user-registered callback associated with a Duktape heap, while panics could happen anywhere without context so that no user-registered callback could be looked up.\r\n\r\nSimplify this as follows:\r\n\r\n- Fatal errors with context are handled as previously: call `heap->fatal_func` which is either a default fatal error handler or a user-registered fatal error handler.\r\n- Fatal errors without context call into a Duktape-wide default fatal error handler (also used if user code doesn't register a fatal error handler in heap creation) with `ctx == NULL`. By default, that handler segfaults and forever loops, and avoids any I/O for portability reasons. The default handler can be replaced via `duk_config.h` if that behavior is not good enough (but see below).\r\n- Remove the error code argument from the `duk_fatal_function` signature (so that it now only takes a `duk_context *ctx, const char *msg`) because the code is pretty useless in practice.\r\n\r\nContext-free fatal errors only happen in two places now: (1) when assertions fail and (2) when self tests fail in heap creation. In other words, if assertions and self tests are disabled, there are no context-free fatal errors at all. Replacing the default fatal handler is thus usually not necessary, but if replaced it must be done via `duk_config.h`; this matches the way panics worked in Duktape 1.x but is simpler conceptually.\r\n\r\n- [x] Simplify `duk_fatal_function` signature by dropping the error code.\r\n- [x] Change `ctx` in fatal function signature into (heap) `udata`: it's less confusing that an arbitrary context pointer, especially because the context pointer cannot be used e.g. in Duktape API calls safely.\r\n- [x] Should `msg` be optional or not?\r\n- [x] Config: remove panic options\r\n- [x] Config: add option to replace default fatal error handler\r\n- [x] Fix internal panic call sites to use fatal errors\r\n- [x] Fix internal fatal error handling call sites for new signature\r\n- [x] Fix other fatal error providers, like Dukweb, ajduk, etc.\r\n- [x] Website update for discussion of errors, fatals, and panics\r\n- [x] Wiki update for fatals and panics; maybe a new how to for fatal error handling with the bulk of the current (rather detailed) website content - https://github.com/svaarala/duktape-wiki/pull/116\r\n- [x] Documentation: cover the default fatal error handler behavior (= intentional segfault) in tutorials; in particular, `duk_create_heap()` documentation should emphasize that unless a fatal error function is registered, the default one segfaults on purpose for uncaught errors\r\n- [x] Test default and user-provided default fatal error handler\r\n- [x] 2.0 migration notes\r\n- [x] Releases entry","created_at":"2016-05-13T22:37:41Z","updated_at":"2016-05-15T21:17:04Z","closed_at":"2016-05-15T21:17:04Z","merged_at":"2016-05-15T21:17:04Z","merge_commit_sha":"2d7cb4bb8a858c6987092e864eff3f7cd28e27a7","assignee":null,"milestone":{"url":"https://api.github.com/repos/svaarala/duktape/milestones/5","html_url":"https://github.com/svaarala/duktape/milestones/v2.0.0","labels_url":"https://api.github.com/repos/svaarala/duktape/milestones/5/labels","id":840957,"number":5,"title":"v2.0.0","description":"","creator":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"open_issues":39,"closed_issues":23,"state":"open","created_at":"2014-10-26T15:05:37Z","updated_at":"2016-05-15T21:17:04Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/svaarala/duktape/pulls/781/commits","review_comments_url":"https://api.github.com/repos/svaarala/duktape/pulls/781/comments","review_comment_url":"https://api.github.com/repos/svaarala/duktape/pulls/comments{/number}","comments_url":"https://api.github.com/repos/svaarala/duktape/issues/781/comments","statuses_url":"https://api.github.com/repos/svaarala/duktape/statuses/176e3413245e7155b04397b79ecaeec4549fcb0f","head":{"label":"svaarala:remove-panic-concept","ref":"remove-panic-concept","sha":"176e3413245e7155b04397b79ecaeec4549fcb0f","user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"repo":{"id":15852088,"name":"duktape","full_name":"svaarala/duktape","owner":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svaarala/duktape","description":"Duktape - embeddable Javascript engine with a focus on portability and compact footprint","fork":false,"url":"https://api.github.com/repos/svaarala/duktape","forks_url":"https://api.github.com/repos/svaarala/duktape/forks","keys_url":"https://api.github.com/repos/svaarala/duktape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svaarala/duktape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svaarala/duktape/teams","hooks_url":"https://api.github.com/repos/svaarala/duktape/hooks","issue_events_url":"https://api.github.com/repos/svaarala/duktape/issues/events{/number}","events_url":"https://api.github.com/repos/svaarala/duktape/events","assignees_url":"https://api.github.com/repos/svaarala/duktape/assignees{/user}","branches_url":"https://api.github.com/repos/svaarala/duktape/branches{/branch}","tags_url":"https://api.github.com/repos/svaarala/duktape/tags","blobs_url":"https://api.github.com/repos/svaarala/duktape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svaarala/duktape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svaarala/duktape/git/refs{/sha}","trees_url":"https://api.github.com/repos/svaarala/duktape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svaarala/duktape/statuses/{sha}","languages_url":"https://api.github.com/repos/svaarala/duktape/languages","stargazers_url":"https://api.github.com/repos/svaarala/duktape/stargazers","contributors_url":"https://api.github.com/repos/svaarala/duktape/contributors","subscribers_url":"https://api.github.com/repos/svaarala/duktape/subscribers","subscription_url":"https://api.github.com/repos/svaarala/duktape/subscription","commits_url":"https://api.github.com/repos/svaarala/duktape/commits{/sha}","git_commits_url":"https://api.github.com/repos/svaarala/duktape/git/commits{/sha}","comments_url":"https://api.github.com/repos/svaarala/duktape/comments{/number}","issue_comment_url":"https://api.github.com/repos/svaarala/duktape/issues/comments{/number}","contents_url":"https://api.github.com/repos/svaarala/duktape/contents/{+path}","compare_url":"https://api.github.com/repos/svaarala/duktape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svaarala/duktape/merges","archive_url":"https://api.github.com/repos/svaarala/duktape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svaarala/duktape/downloads","issues_url":"https://api.github.com/repos/svaarala/duktape/issues{/number}","pulls_url":"https://api.github.com/repos/svaarala/duktape/pulls{/number}","milestones_url":"https://api.github.com/repos/svaarala/duktape/milestones{/number}","notifications_url":"https://api.github.com/repos/svaarala/duktape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svaarala/duktape/labels{/name}","releases_url":"https://api.github.com/repos/svaarala/duktape/releases{/id}","deployments_url":"https://api.github.com/repos/svaarala/duktape/deployments","created_at":"2014-01-12T22:16:14Z","updated_at":"2016-05-14T16:03:24Z","pushed_at":"2016-05-15T21:17:04Z","git_url":"git://github.com/svaarala/duktape.git","ssh_url":"git@github.com:svaarala/duktape.git","clone_url":"https://github.com/svaarala/duktape.git","svn_url":"https://github.com/svaarala/duktape","homepage":null,"size":72596,"stargazers_count":2172,"watchers_count":2172,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":227,"forks":202,"open_issues":227,"watchers":2172,"default_branch":"master"}},"base":{"label":"svaarala:master","ref":"master","sha":"289d1fee42418f478ac165dbf0e60effec072ec4","user":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"repo":{"id":15852088,"name":"duktape","full_name":"svaarala/duktape","owner":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/svaarala/duktape","description":"Duktape - embeddable Javascript engine with a focus on portability and compact footprint","fork":false,"url":"https://api.github.com/repos/svaarala/duktape","forks_url":"https://api.github.com/repos/svaarala/duktape/forks","keys_url":"https://api.github.com/repos/svaarala/duktape/keys{/key_id}","collaborators_url":"https://api.github.com/repos/svaarala/duktape/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/svaarala/duktape/teams","hooks_url":"https://api.github.com/repos/svaarala/duktape/hooks","issue_events_url":"https://api.github.com/repos/svaarala/duktape/issues/events{/number}","events_url":"https://api.github.com/repos/svaarala/duktape/events","assignees_url":"https://api.github.com/repos/svaarala/duktape/assignees{/user}","branches_url":"https://api.github.com/repos/svaarala/duktape/branches{/branch}","tags_url":"https://api.github.com/repos/svaarala/duktape/tags","blobs_url":"https://api.github.com/repos/svaarala/duktape/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/svaarala/duktape/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/svaarala/duktape/git/refs{/sha}","trees_url":"https://api.github.com/repos/svaarala/duktape/git/trees{/sha}","statuses_url":"https://api.github.com/repos/svaarala/duktape/statuses/{sha}","languages_url":"https://api.github.com/repos/svaarala/duktape/languages","stargazers_url":"https://api.github.com/repos/svaarala/duktape/stargazers","contributors_url":"https://api.github.com/repos/svaarala/duktape/contributors","subscribers_url":"https://api.github.com/repos/svaarala/duktape/subscribers","subscription_url":"https://api.github.com/repos/svaarala/duktape/subscription","commits_url":"https://api.github.com/repos/svaarala/duktape/commits{/sha}","git_commits_url":"https://api.github.com/repos/svaarala/duktape/git/commits{/sha}","comments_url":"https://api.github.com/repos/svaarala/duktape/comments{/number}","issue_comment_url":"https://api.github.com/repos/svaarala/duktape/issues/comments{/number}","contents_url":"https://api.github.com/repos/svaarala/duktape/contents/{+path}","compare_url":"https://api.github.com/repos/svaarala/duktape/compare/{base}...{head}","merges_url":"https://api.github.com/repos/svaarala/duktape/merges","archive_url":"https://api.github.com/repos/svaarala/duktape/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/svaarala/duktape/downloads","issues_url":"https://api.github.com/repos/svaarala/duktape/issues{/number}","pulls_url":"https://api.github.com/repos/svaarala/duktape/pulls{/number}","milestones_url":"https://api.github.com/repos/svaarala/duktape/milestones{/number}","notifications_url":"https://api.github.com/repos/svaarala/duktape/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/svaarala/duktape/labels{/name}","releases_url":"https://api.github.com/repos/svaarala/duktape/releases{/id}","deployments_url":"https://api.github.com/repos/svaarala/duktape/deployments","created_at":"2014-01-12T22:16:14Z","updated_at":"2016-05-14T16:03:24Z","pushed_at":"2016-05-15T21:17:04Z","git_url":"git://github.com/svaarala/duktape.git","ssh_url":"git@github.com:svaarala/duktape.git","clone_url":"https://github.com/svaarala/duktape.git","svn_url":"https://github.com/svaarala/duktape","homepage":null,"size":72596,"stargazers_count":2172,"watchers_count":2172,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":202,"mirror_url":null,"open_issues_count":227,"forks":202,"open_issues":227,"watchers":2172,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/781"},"html":{"href":"https://github.com/svaarala/duktape/pull/781"},"issue":{"href":"https://api.github.com/repos/svaarala/duktape/issues/781"},"comments":{"href":"https://api.github.com/repos/svaarala/duktape/issues/781/comments"},"review_comments":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/781/comments"},"review_comment":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/svaarala/duktape/pulls/781/commits"},"statuses":{"href":"https://api.github.com/repos/svaarala/duktape/statuses/176e3413245e7155b04397b79ecaeec4549fcb0f"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"svaarala","id":6377415,"avatar_url":"https://avatars.githubusercontent.com/u/6377415?v=3","gravatar_id":"","url":"https://api.github.com/users/svaarala","html_url":"https://github.com/svaarala","followers_url":"https://api.github.com/users/svaarala/followers","following_url":"https://api.github.com/users/svaarala/following{/other_user}","gists_url":"https://api.github.com/users/svaarala/gists{/gist_id}","starred_url":"https://api.github.com/users/svaarala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svaarala/subscriptions","organizations_url":"https://api.github.com/users/svaarala/orgs","repos_url":"https://api.github.com/users/svaarala/repos","events_url":"https://api.github.com/users/svaarala/events{/privacy}","received_events_url":"https://api.github.com/users/svaarala/received_events","type":"User","site_admin":false},"comments":6,"review_comments":0,"commits":14,"additions":457,"deletions":291,"changed_files":33}}