{"action":"created","issue":{"url":"https://api.github.com/repos/nodejs/node/issues/13929","repository_url":"https://api.github.com/repos/nodejs/node","labels_url":"https://api.github.com/repos/nodejs/node/issues/13929/labels{/name}","comments_url":"https://api.github.com/repos/nodejs/node/issues/13929/comments","events_url":"https://api.github.com/repos/nodejs/node/issues/13929/events","html_url":"https://github.com/nodejs/node/issues/13929","id":238579217,"number":13929,"title":"Promise stack trace is noisy","user":{"login":"AndreasMadsen","id":505333,"avatar_url":"https://avatars3.githubusercontent.com/u/505333?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreasMadsen","html_url":"https://github.com/AndreasMadsen","followers_url":"https://api.github.com/users/AndreasMadsen/followers","following_url":"https://api.github.com/users/AndreasMadsen/following{/other_user}","gists_url":"https://api.github.com/users/AndreasMadsen/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreasMadsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreasMadsen/subscriptions","organizations_url":"https://api.github.com/users/AndreasMadsen/orgs","repos_url":"https://api.github.com/users/AndreasMadsen/repos","events_url":"https://api.github.com/users/AndreasMadsen/events{/privacy}","received_events_url":"https://api.github.com/users/AndreasMadsen/received_events","type":"User","site_admin":false},"labels":[{"id":340436277,"url":"https://api.github.com/repos/nodejs/node/labels/promises","name":"promises","color":"f7c6c7","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2017-06-26T15:23:42Z","updated_at":"2017-06-27T11:21:04Z","closed_at":null,"body":"* **Version**: node 9.0.0-pre (76340e3f1007998c7cb9d69fa1a42d42663ca6c2)\r\n* **Platform**: MacOS\r\n* **Subsystem**: promise\r\n\r\nConsider the code:\r\n\r\n```js\r\nPromise.resolve().then(function then() {\r\n  console.log(new Error().stack);\r\n});\r\n```\r\n\r\nIn node.js this produces the stack trace:\r\n\r\n```\r\nError\r\n    at then (/trace/test.js:2:19)\r\n    at <anonymous>\r\n    at process._tickCallback (internal/process/next_tick.js:209:7)\r\n    at Function.Module.runMain (module.js:607:11)\r\n    at startup (bootstrap_node.js:158:16)\r\n    at bootstrap_node.js:575:3\r\n```\r\n\r\nIn google chrome this produces the stack trace:\r\n\r\n```\r\nError\r\n    at then (<anonymous>:2:15)\r\n    at <anonymous>\r\n```\r\n\r\nEverything between `process._tickCallback` and `bootstrap_node.js` is just pure noise and is caused by how we fuse the microtask queue and `nextTick`. The information has no value to the user and it is quite hard to remove using a userland module. I would like to see a different solution, perhaps one that involves PromiseHooks, where that noise is removed.\r\n\r\n/cc @addaleax @matthewloring "},"comment":{"url":"https://api.github.com/repos/nodejs/node/issues/comments/311329179","html_url":"https://github.com/nodejs/node/issues/13929#issuecomment-311329179","issue_url":"https://api.github.com/repos/nodejs/node/issues/13929","id":311329179,"user":{"login":"AndreasMadsen","id":505333,"avatar_url":"https://avatars3.githubusercontent.com/u/505333?v=3","gravatar_id":"","url":"https://api.github.com/users/AndreasMadsen","html_url":"https://github.com/AndreasMadsen","followers_url":"https://api.github.com/users/AndreasMadsen/followers","following_url":"https://api.github.com/users/AndreasMadsen/following{/other_user}","gists_url":"https://api.github.com/users/AndreasMadsen/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreasMadsen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreasMadsen/subscriptions","organizations_url":"https://api.github.com/users/AndreasMadsen/orgs","repos_url":"https://api.github.com/users/AndreasMadsen/repos","events_url":"https://api.github.com/users/AndreasMadsen/events{/privacy}","received_events_url":"https://api.github.com/users/AndreasMadsen/received_events","type":"User","site_admin":false},"created_at":"2017-06-27T11:21:04Z","updated_at":"2017-06-27T11:21:04Z","body":"> Calling `<anonymous>` from src/node.cc (either by dropping out of `uv_run()` or through a check or prepare handle) would be one way to get rid of the extra stack frames.\r\n\r\nIndeed, this is the kind of solution I had in mind. But I don't know if it can be done without performance impact or without a change in the timeing of `nextTick` and `Promise.prototype.then`."}}
{"actor":{"display_login":"AndreasMadsen"}}