{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/4507","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/4507/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/4507/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/4507/events","html_url":"https://github.com/nodejs/node/pull/4507","id":124560068,"number":4507,"title":"src: fix MakeCallback error handling","user":{"login":"trevnorris","id":289174,"avatar_url":"https://avatars.githubusercontent.com/u/289174?v=3","gravatar_id":"","url":"https://api.github.com/users/trevnorris","html_url":"https://github.com/trevnorris","followers_url":"https://api.github.com/users/trevnorris/followers","following_url":"https://api.github.com/users/trevnorris/following{/other_user}","gists_url":"https://api.github.com/users/trevnorris/gists{/gist_id}","starred_url":"https://api.github.com/users/trevnorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevnorris/subscriptions","organizations_url":"https://api.github.com/users/trevnorris/orgs","repos_url":"https://api.github.com/users/trevnorris/repos","events_url":"https://api.github.com/users/trevnorris/events{/privacy}","received_events_url":"https://api.github.com/users/trevnorris/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nodejs/node/labels/c++","name":"c++","color":"e11d21"},{"url":"https://api.github.com/repos/nodejs/node/labels/lts-landed-on-v4.x","name":"lts-landed-on-v4.x","color":"d4c5f9"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":43,"created_at":"2016-01-01T20:21:49Z","updated_at":"2016-02-18T10:23:27Z","closed_at":"2016-02-12T21:07:16Z","pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/4507","html_url":"https://github.com/nodejs/node/pull/4507","diff_url":"https://github.com/nodejs/node/pull/4507.diff","patch_url":"https://github.com/nodejs/node/pull/4507.patch"},"body":"The final goal of this PR is to allow `MakeCallback` (in both `node::` and `AsyncWrap::`) to be reentrant. Reason is because the `HTTPParser` may enter the JS call stack initially, or be called while already in a stack (see @indutny's PR https://github.com/nodejs/node/pull/4509). Also so native addon developers can always use `node::MakeCallback` without the worry of code being executed in the wrong order (specifically in relation to usage of `nextTick` or the `MicrotaskQueue`).\r\n\r\nTo do this I first made sure the two implementations of `MakeCallback` were the same. Previously they would return at different points in the case of caught exception.\r\n\r\nFinally was the addition of `AsyncCallbackScope` (admittedly the concept was taken from Fedor's PR above) to allow `MakeCallback` to be called recursively without each subsequent call from processing the `nextTickQueue` or the `MicrotaskQueue`.\r\n\r\nI am working with @misterdjules on the proper way of handling domains. So this PR is currently a WIP.\r\n\r\nRef: https://github.com/nodejs/node-v0.x-archive/issues/9245\r\n\r\nR=@bnoordhuis \r\nR=@indutny "},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/185642075","html_url":"https://github.com/nodejs/node/pull/4507#issuecomment-185642075","issue_url":"https://api.github.com/repos/nodejs/node/issues/4507","id":185642075,"user":{"login":"trevnorris","id":289174,"avatar_url":"https://avatars.githubusercontent.com/u/289174?v=3","gravatar_id":"","url":"https://api.github.com/users/trevnorris","html_url":"https://github.com/trevnorris","followers_url":"https://api.github.com/users/trevnorris/followers","following_url":"https://api.github.com/users/trevnorris/following{/other_user}","gists_url":"https://api.github.com/users/trevnorris/gists{/gist_id}","starred_url":"https://api.github.com/users/trevnorris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/trevnorris/subscriptions","organizations_url":"https://api.github.com/users/trevnorris/orgs","repos_url":"https://api.github.com/users/trevnorris/repos","events_url":"https://api.github.com/users/trevnorris/events{/privacy}","received_events_url":"https://api.github.com/users/trevnorris/received_events","type":"User","site_admin":false},"created_at":"2016-02-18T10:23:27Z","updated_at":"2016-02-18T10:23:27Z","body":"@rvagg There was discussion going on about this in a couple locations, including https://github.com/nodejs/node-v0.x-archive/issues/9245 with @kkoopa's participation. So this change would be of interest to nan."}}