{"action":"created","issue":{"url":"https://api.github.com/repos/svaarala/duktape/issues/191","labels_url":"https://api.github.com/repos/svaarala/duktape/issues/191/labels{/name}","comments_url":"https://api.github.com/repos/svaarala/duktape/issues/191/comments","events_url":"https://api.github.com/repos/svaarala/duktape/issues/191/events","html_url":"https://github.com/svaarala/duktape/issues/191","id":75691342,"number":191,"title":"Infinitely recursive function causes double error","user":{"login":"fatcerberus","id":4097841,"avatar_url":"https://avatars.githubusercontent.com/u/4097841?v=3","gravatar_id":"","url":"https://api.github.com/users/fatcerberus","html_url":"https://github.com/fatcerberus","followers_url":"https://api.github.com/users/fatcerberus/followers","following_url":"https://api.github.com/users/fatcerberus/following{/other_user}","gists_url":"https://api.github.com/users/fatcerberus/gists{/gist_id}","starred_url":"https://api.github.com/users/fatcerberus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatcerberus/subscriptions","organizations_url":"https://api.github.com/users/fatcerberus/orgs","repos_url":"https://api.github.com/users/fatcerberus/repos","events_url":"https://api.github.com/users/fatcerberus/events{/privacy}","received_events_url":"https://api.github.com/users/fatcerberus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-05-12T18:20:19Z","updated_at":"2015-05-12T19:47:20Z","closed_at":null,"body":"The following:\r\n\r\n```javascript\r\nfunction f() { f(); }\r\nf();\r\n```\r\n\r\nCauses Duktape to throw \"DoubleError: Error in error handling\".  It would be more informative if this could be fixed to throw a \"Too much recursion\" error like SpiderMonkey does."},"comment":{"url":"https://api.github.com/repos/svaarala/duktape/issues/comments/101398753","html_url":"https://github.com/svaarala/duktape/issues/191#issuecomment-101398753","issue_url":"https://api.github.com/repos/svaarala/duktape/issues/191","id":101398753,"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},"created_at":"2015-05-12T19:47:20Z","updated_at":"2015-05-12T19:47:20Z","body":"The fatal error handler is called when it's no longer safe to continue execution within Duktape. This is also why the fatal error handler is not supposed to return: there's no safe way to continue. For similar reasons you probably shouldn't call into Duktape in a fatal error handler as doing so might be unsafe and might cause a longjmp if an error is thrown.\r\n\r\nThat's the general contract anyway. In the case of an uncaught error you should be able to call into Duktape although I wouldn't really recommend that as it's not \"guaranteed\" to work. Anyway, if you do so, you must protect against an error being thrown; if you don't and that error propagates outwards, the results are basically undefined. I'm not sure what happens now; it might cause another fatal error.\r\n\r\nIf you want to catch uncaught script errors (which is quite useful) it's probably best to use a protected call when you call into scripts and handle errors explicitly rather than relying on a fatal error handler."}}