{"action":"created","issue":{"url":"https://api.github.com/repos/chalk/chalk/issues/80","labels_url":"https://api.github.com/repos/chalk/chalk/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/chalk/chalk/issues/80/comments","events_url":"https://api.github.com/repos/chalk/chalk/issues/80/events","html_url":"https://github.com/chalk/chalk/issues/80","id":101259425,"number":80,"title":"Very strange async problem","user":{"login":"lukeapage","id":309321,"avatar_url":"https://avatars.githubusercontent.com/u/309321?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeapage","html_url":"https://github.com/lukeapage","followers_url":"https://api.github.com/users/lukeapage/followers","following_url":"https://api.github.com/users/lukeapage/following{/other_user}","gists_url":"https://api.github.com/users/lukeapage/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeapage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeapage/subscriptions","organizations_url":"https://api.github.com/users/lukeapage/orgs","repos_url":"https://api.github.com/users/lukeapage/repos","events_url":"https://api.github.com/users/lukeapage/events{/privacy}","received_events_url":"https://api.github.com/users/lukeapage/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":12,"created_at":"2015-08-16T12:26:30Z","updated_at":"2015-08-19T17:58:12Z","closed_at":null,"body":"I'm getting a strange problem when the first use of chalk is in an async callback thread.\r\nNode 0.12.6\r\n\r\n```\r\n[ReferenceError: builder is not defined]\r\nReferenceError: builder is not defined\r\n    at Chalk.builder (c:\\git\\node-markdown-spellcheck\\node_modules\\chalk\\index.js:40:27)\r\n    at c:\\git\\node-markdown-spellcheck\\es5\\cli.js:221:58\r\n    at c:\\git\\node-markdown-spellcheck\\node_modules\\async\\lib\\async.js:187:20\r\n    at iterate (c:\\git\\node-markdown-spellcheck\\node_modules\\async\\lib\\async.js:265:13)\r\n    at Object.async.forEachOfSeries.async.eachOfSeries (c:\\git\\node-markdown-spellcheck\\node_modules\\async\\lib\\async.js:284:9)\r\n    at Object.async.forEachSeries.async.eachSeries (c:\\git\\node-markdown-spellcheck\\node_modules\\async\\lib\\async.js:220:22)\r\n    at c:\\git\\node-markdown-spellcheck\\es5\\cli.js:219:26\r\n    at c:\\git\\node-markdown-spellcheck\\node_modules\\async\\lib\\async.js:697:13\r\n    at c:\\git\\node-markdown-spellcheck\\node_modules\\async\\lib\\async.js:52:16\r\n    at done (c:\\git\\node-markdown-spellcheck\\node_modules\\async\\lib\\async.js:248:21)\r\n```\r\n\r\nI've looked at the code\r\n\r\n```\r\n\tvar builder = function builder() {\r\n\t\treturn applyStyle.apply(builder, arguments);\r\n\t};\r\n```\r\n\r\nand I've no idea why it is going wrong - the function expression name should be exposed.\r\n\r\nIf I change the chalk code in my node_modules to...\r\n\r\n```\r\n\tvar builder = function () {\r\n\t\treturn applyStyle.apply(builder, arguments);\r\n\t};\r\n```\r\n\r\nthen it works.\r\n\r\nIf I add a dummy call to chalk before I start doing async things, it works\r\n\r\n```\r\nchalk.red(\"red\"); // fix very weird bug\r\n```\r\n\r\nThe only explanation I have is that its a weird V8 bug. I'm raising here in case there is something I missed, or you have seen it before or you had been thinking about removing the function name anyway."},"comment":{"url":"https://api.github.com/repos/chalk/chalk/issues/comments/132721946","html_url":"https://github.com/chalk/chalk/issues/80#issuecomment-132721946","issue_url":"https://api.github.com/repos/chalk/chalk/issues/80","id":132721946,"user":{"login":"lukeapage","id":309321,"avatar_url":"https://avatars.githubusercontent.com/u/309321?v=3","gravatar_id":"","url":"https://api.github.com/users/lukeapage","html_url":"https://github.com/lukeapage","followers_url":"https://api.github.com/users/lukeapage/followers","following_url":"https://api.github.com/users/lukeapage/following{/other_user}","gists_url":"https://api.github.com/users/lukeapage/gists{/gist_id}","starred_url":"https://api.github.com/users/lukeapage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukeapage/subscriptions","organizations_url":"https://api.github.com/users/lukeapage/orgs","repos_url":"https://api.github.com/users/lukeapage/repos","events_url":"https://api.github.com/users/lukeapage/events{/privacy}","received_events_url":"https://api.github.com/users/lukeapage/received_events","type":"User","site_admin":false},"created_at":"2015-08-19T17:58:12Z","updated_at":"2015-08-19T17:58:12Z","body":"@caitp, knowing you work on V8, does this bug ring a bell with you? I've searched the V8 issues and I can't see a named function expression bug that has been raised or fixed recently"}}