{"action":"closed","issue":{"url":"https://api.github.com/repos/iojs/io.js/issues/666","labels_url":"https://api.github.com/repos/iojs/io.js/issues/666/labels{/name}","comments_url":"https://api.github.com/repos/iojs/io.js/issues/666/comments","events_url":"https://api.github.com/repos/iojs/io.js/issues/666/events","html_url":"https://github.com/iojs/io.js/issues/666","id":56036700,"number":666,"title":"async-wrap: nextTick and setImmediate is ignored","user":{"login":"AndreasMadsen","id":505333,"avatar_url":"https://avatars.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":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-01-30T14:03:31Z","updated_at":"2015-02-02T08:27:58Z","closed_at":"2015-02-02T08:27:58Z","body":"Here is a test case you can run with _node 0.11.14_ and _iojs 1.0.x_.\r\n\r\n```js\r\nvar fs = require('fs');\r\nfunction writeSync(text) { fs.writeSync(1, text + '\\n'); fs.fsyncSync(1); }\r\nError.stackTraceLimit = Infinity;\r\n\r\n// Enable asyncWrap and call init hook function on async initialization\r\ntry {\r\n  var tracing = require('tracing');\r\n  // Setup an async listener with the handlers listed below\r\n  tracing.addAsyncListener({\r\n    'create': asyncFunctionInitialized,\r\n    'before': asyncCallbackBefore,\r\n    'error': asyncCallbackError,\r\n    'after': asyncCallbackAfter\r\n  });\r\n} catch (e) {\r\n  var asyncWrap = process.binding('async_wrap');\r\n  var asyncHooksObject = {};\r\n  var kCallInitHook = 0;\r\n  asyncWrap.setupHooks(\r\n    asyncHooksObject,\r\n    asyncFunctionInitialized,\r\n    asyncCallbackBefore,\r\n    asyncCallbackAfter);\r\n  asyncHooksObject[kCallInitHook] = 1;\r\n}\r\n\r\nfunction asyncFunctionInitialized() {\r\n  writeSync((new Error()).stack);\r\n}\r\nfunction asyncCallbackBefore() {}\r\nfunction asyncCallbackError() {}\r\nfunction asyncCallbackAfter() {}\r\n\r\n// TEST\r\n(function outer() {\r\n  setImmediate(function () {\r\n    writeSync('END');\r\n  });\r\n})();\r\n```\r\n\r\nIn the node 0.11.14 `asyncFunctionInitialized` is called and the stack trace is printed. However in iojs 1.0.x just `END` is printed. This also seams to be the case for `process.nextTick`.\r\n\r\n_issue tracing: https://github.com/AndreasMadsen/trace/issues/12_"}}