{"action":"created","comment":{"url":"https://api.github.com/repos/pillarjs/router/pulls/comments/40980656","id":40980656,"diff_hunk":"@@ -48,6 +48,33 @@ function Layer(path, options, fn) {\n }\n \n /**\n+ * Handle any request for the layer.\n+ *\n+ * @api private\n+ */\n+\n+Layer.prototype._handle_any = function _handle_any(/* ...args, next */) {\n+  var self = this\n+  var args = Array.prototype.slice.call(arguments)\n+  var next = args.pop()\n+  var handle = this.handle\n+  var result\n+  var hasNextBeenCalled = function () { return next._currentLayer === self }\n+\n+  try {\n+    result = handle.apply(undefined, args.concat([next]))\n+  } catch (err) {\n+    return next(err)\n+  }\n+\n+  if (result != null && typeof result.then === 'function') {\n+    var onFulfilled = function () { /* Silence... */ }\n+    var onRejected = function (error) { if (!hasNextBeenCalled()) { next(error) } }\n+    result.then(onFulfilled, onRejected)","path":"lib/layer.js","position":26,"original_position":26,"commit_id":"f5a61453c89a55e49d7e5b4771affa1eabacb465","original_commit_id":"f5a61453c89a55e49d7e5b4771affa1eabacb465","user":{"login":"blakeembrey","id":1088987,"avatar_url":"https://avatars.githubusercontent.com/u/1088987?v=3","gravatar_id":"","url":"https://api.github.com/users/blakeembrey","html_url":"https://github.com/blakeembrey","followers_url":"https://api.github.com/users/blakeembrey/followers","following_url":"https://api.github.com/users/blakeembrey/following{/other_user}","gists_url":"https://api.github.com/users/blakeembrey/gists{/gist_id}","starred_url":"https://api.github.com/users/blakeembrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blakeembrey/subscriptions","organizations_url":"https://api.github.com/users/blakeembrey/orgs","repos_url":"https://api.github.com/users/blakeembrey/repos","events_url":"https://api.github.com/users/blakeembrey/events{/privacy}","received_events_url":"https://api.github.com/users/blakeembrey/received_events","type":"User","site_admin":false},"body":"You could just do `result.then(null, onRejected)`.","created_at":"2015-10-01T23:53:58Z","updated_at":"2015-10-01T23:53:58Z","html_url":"https://github.com/pillarjs/router/pull/25#discussion_r40980656","pull_request_url":"https://api.github.com/repos/pillarjs/router/pulls/25","_links":{"self":{"href":"https://api.github.com/repos/pillarjs/router/pulls/comments/40980656"},"html":{"href":"https://github.com/pillarjs/router/pull/25#discussion_r40980656"},"pull_request":{"href":"https://api.github.com/repos/pillarjs/router/pulls/25"}}},"pull_request":{"url":"https://api.github.com/repos/pillarjs/router/pulls/25","id":46590086,"html_url":"https://github.com/pillarjs/router/pull/25","diff_url":"https://github.com/pillarjs/router/pull/25.diff","patch_url":"https://github.com/pillarjs/router/pull/25.patch","issue_url":"https://api.github.com/repos/pillarjs/router/issues/25","number":25,"state":"open","locked":false,"title":"Add promise support","user":{"login":"calebmer","id":8282507,"avatar_url":"https://avatars.githubusercontent.com/u/8282507?v=3","gravatar_id":"","url":"https://api.github.com/users/calebmer","html_url":"https://github.com/calebmer","followers_url":"https://api.github.com/users/calebmer/followers","following_url":"https://api.github.com/users/calebmer/following{/other_user}","gists_url":"https://api.github.com/users/calebmer/gists{/gist_id}","starred_url":"https://api.github.com/users/calebmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebmer/subscriptions","organizations_url":"https://api.github.com/users/calebmer/orgs","repos_url":"https://api.github.com/users/calebmer/repos","events_url":"https://api.github.com/users/calebmer/events{/privacy}","received_events_url":"https://api.github.com/users/calebmer/received_events","type":"User","site_admin":false},"body":"Moved from strongloop/express#2763\r\n\r\nOnce this is ready to merge, I want to try to implement the `next` plan from strongloop/express#2259, which would require an optional `Promise` library.\r\n\r\nAlso, I'm not familiar with your policy for backwards compatibility (or if one exists at all) in express 5.0, that could be helpful to know.","created_at":"2015-10-01T23:39:41Z","updated_at":"2015-10-01T23:53:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f09b55ecd0f44a5c130d8db3b5b7d1e01ad4de8","assignee":{"login":"dougwilson","id":67512,"avatar_url":"https://avatars.githubusercontent.com/u/67512?v=3","gravatar_id":"","url":"https://api.github.com/users/dougwilson","html_url":"https://github.com/dougwilson","followers_url":"https://api.github.com/users/dougwilson/followers","following_url":"https://api.github.com/users/dougwilson/following{/other_user}","gists_url":"https://api.github.com/users/dougwilson/gists{/gist_id}","starred_url":"https://api.github.com/users/dougwilson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougwilson/subscriptions","organizations_url":"https://api.github.com/users/dougwilson/orgs","repos_url":"https://api.github.com/users/dougwilson/repos","events_url":"https://api.github.com/users/dougwilson/events{/privacy}","received_events_url":"https://api.github.com/users/dougwilson/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/pillarjs/router/pulls/25/commits","review_comments_url":"https://api.github.com/repos/pillarjs/router/pulls/25/comments","review_comment_url":"https://api.github.com/repos/pillarjs/router/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pillarjs/router/issues/25/comments","statuses_url":"https://api.github.com/repos/pillarjs/router/statuses/f5a61453c89a55e49d7e5b4771affa1eabacb465","head":{"label":"calebmer:master","ref":"master","sha":"f5a61453c89a55e49d7e5b4771affa1eabacb465","user":{"login":"calebmer","id":8282507,"avatar_url":"https://avatars.githubusercontent.com/u/8282507?v=3","gravatar_id":"","url":"https://api.github.com/users/calebmer","html_url":"https://github.com/calebmer","followers_url":"https://api.github.com/users/calebmer/followers","following_url":"https://api.github.com/users/calebmer/following{/other_user}","gists_url":"https://api.github.com/users/calebmer/gists{/gist_id}","starred_url":"https://api.github.com/users/calebmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebmer/subscriptions","organizations_url":"https://api.github.com/users/calebmer/orgs","repos_url":"https://api.github.com/users/calebmer/repos","events_url":"https://api.github.com/users/calebmer/events{/privacy}","received_events_url":"https://api.github.com/users/calebmer/received_events","type":"User","site_admin":false},"repo":{"id":43526558,"name":"router","full_name":"calebmer/router","owner":{"login":"calebmer","id":8282507,"avatar_url":"https://avatars.githubusercontent.com/u/8282507?v=3","gravatar_id":"","url":"https://api.github.com/users/calebmer","html_url":"https://github.com/calebmer","followers_url":"https://api.github.com/users/calebmer/followers","following_url":"https://api.github.com/users/calebmer/following{/other_user}","gists_url":"https://api.github.com/users/calebmer/gists{/gist_id}","starred_url":"https://api.github.com/users/calebmer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/calebmer/subscriptions","organizations_url":"https://api.github.com/users/calebmer/orgs","repos_url":"https://api.github.com/users/calebmer/repos","events_url":"https://api.github.com/users/calebmer/events{/privacy}","received_events_url":"https://api.github.com/users/calebmer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/calebmer/router","description":"Simple middleware-style router","fork":true,"url":"https://api.github.com/repos/calebmer/router","forks_url":"https://api.github.com/repos/calebmer/router/forks","keys_url":"https://api.github.com/repos/calebmer/router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/calebmer/router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/calebmer/router/teams","hooks_url":"https://api.github.com/repos/calebmer/router/hooks","issue_events_url":"https://api.github.com/repos/calebmer/router/issues/events{/number}","events_url":"https://api.github.com/repos/calebmer/router/events","assignees_url":"https://api.github.com/repos/calebmer/router/assignees{/user}","branches_url":"https://api.github.com/repos/calebmer/router/branches{/branch}","tags_url":"https://api.github.com/repos/calebmer/router/tags","blobs_url":"https://api.github.com/repos/calebmer/router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/calebmer/router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/calebmer/router/git/refs{/sha}","trees_url":"https://api.github.com/repos/calebmer/router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/calebmer/router/statuses/{sha}","languages_url":"https://api.github.com/repos/calebmer/router/languages","stargazers_url":"https://api.github.com/repos/calebmer/router/stargazers","contributors_url":"https://api.github.com/repos/calebmer/router/contributors","subscribers_url":"https://api.github.com/repos/calebmer/router/subscribers","subscription_url":"https://api.github.com/repos/calebmer/router/subscription","commits_url":"https://api.github.com/repos/calebmer/router/commits{/sha}","git_commits_url":"https://api.github.com/repos/calebmer/router/git/commits{/sha}","comments_url":"https://api.github.com/repos/calebmer/router/comments{/number}","issue_comment_url":"https://api.github.com/repos/calebmer/router/issues/comments{/number}","contents_url":"https://api.github.com/repos/calebmer/router/contents/{+path}","compare_url":"https://api.github.com/repos/calebmer/router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/calebmer/router/merges","archive_url":"https://api.github.com/repos/calebmer/router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/calebmer/router/downloads","issues_url":"https://api.github.com/repos/calebmer/router/issues{/number}","pulls_url":"https://api.github.com/repos/calebmer/router/pulls{/number}","milestones_url":"https://api.github.com/repos/calebmer/router/milestones{/number}","notifications_url":"https://api.github.com/repos/calebmer/router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/calebmer/router/labels{/name}","releases_url":"https://api.github.com/repos/calebmer/router/releases{/id}","created_at":"2015-10-01T23:28:10Z","updated_at":"2015-10-01T23:28:10Z","pushed_at":"2015-10-01T23:41:54Z","git_url":"git://github.com/calebmer/router.git","ssh_url":"git@github.com:calebmer/router.git","clone_url":"https://github.com/calebmer/router.git","svn_url":"https://github.com/calebmer/router","homepage":"","size":820,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pillarjs:master","ref":"master","sha":"6bae01f1e9de52445b0f353b720214ca798b3089","user":{"login":"pillarjs","id":8441312,"avatar_url":"https://avatars.githubusercontent.com/u/8441312?v=3","gravatar_id":"","url":"https://api.github.com/users/pillarjs","html_url":"https://github.com/pillarjs","followers_url":"https://api.github.com/users/pillarjs/followers","following_url":"https://api.github.com/users/pillarjs/following{/other_user}","gists_url":"https://api.github.com/users/pillarjs/gists{/gist_id}","starred_url":"https://api.github.com/users/pillarjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pillarjs/subscriptions","organizations_url":"https://api.github.com/users/pillarjs/orgs","repos_url":"https://api.github.com/users/pillarjs/repos","events_url":"https://api.github.com/users/pillarjs/events{/privacy}","received_events_url":"https://api.github.com/users/pillarjs/received_events","type":"Organization","site_admin":false},"repo":{"id":23059630,"name":"router","full_name":"pillarjs/router","owner":{"login":"pillarjs","id":8441312,"avatar_url":"https://avatars.githubusercontent.com/u/8441312?v=3","gravatar_id":"","url":"https://api.github.com/users/pillarjs","html_url":"https://github.com/pillarjs","followers_url":"https://api.github.com/users/pillarjs/followers","following_url":"https://api.github.com/users/pillarjs/following{/other_user}","gists_url":"https://api.github.com/users/pillarjs/gists{/gist_id}","starred_url":"https://api.github.com/users/pillarjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pillarjs/subscriptions","organizations_url":"https://api.github.com/users/pillarjs/orgs","repos_url":"https://api.github.com/users/pillarjs/repos","events_url":"https://api.github.com/users/pillarjs/events{/privacy}","received_events_url":"https://api.github.com/users/pillarjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pillarjs/router","description":"Simple middleware-style router","fork":false,"url":"https://api.github.com/repos/pillarjs/router","forks_url":"https://api.github.com/repos/pillarjs/router/forks","keys_url":"https://api.github.com/repos/pillarjs/router/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pillarjs/router/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pillarjs/router/teams","hooks_url":"https://api.github.com/repos/pillarjs/router/hooks","issue_events_url":"https://api.github.com/repos/pillarjs/router/issues/events{/number}","events_url":"https://api.github.com/repos/pillarjs/router/events","assignees_url":"https://api.github.com/repos/pillarjs/router/assignees{/user}","branches_url":"https://api.github.com/repos/pillarjs/router/branches{/branch}","tags_url":"https://api.github.com/repos/pillarjs/router/tags","blobs_url":"https://api.github.com/repos/pillarjs/router/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pillarjs/router/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pillarjs/router/git/refs{/sha}","trees_url":"https://api.github.com/repos/pillarjs/router/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pillarjs/router/statuses/{sha}","languages_url":"https://api.github.com/repos/pillarjs/router/languages","stargazers_url":"https://api.github.com/repos/pillarjs/router/stargazers","contributors_url":"https://api.github.com/repos/pillarjs/router/contributors","subscribers_url":"https://api.github.com/repos/pillarjs/router/subscribers","subscription_url":"https://api.github.com/repos/pillarjs/router/subscription","commits_url":"https://api.github.com/repos/pillarjs/router/commits{/sha}","git_commits_url":"https://api.github.com/repos/pillarjs/router/git/commits{/sha}","comments_url":"https://api.github.com/repos/pillarjs/router/comments{/number}","issue_comment_url":"https://api.github.com/repos/pillarjs/router/issues/comments{/number}","contents_url":"https://api.github.com/repos/pillarjs/router/contents/{+path}","compare_url":"https://api.github.com/repos/pillarjs/router/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pillarjs/router/merges","archive_url":"https://api.github.com/repos/pillarjs/router/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pillarjs/router/downloads","issues_url":"https://api.github.com/repos/pillarjs/router/issues{/number}","pulls_url":"https://api.github.com/repos/pillarjs/router/pulls{/number}","milestones_url":"https://api.github.com/repos/pillarjs/router/milestones{/number}","notifications_url":"https://api.github.com/repos/pillarjs/router/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pillarjs/router/labels{/name}","releases_url":"https://api.github.com/repos/pillarjs/router/releases{/id}","created_at":"2014-08-18T05:22:58Z","updated_at":"2015-10-01T05:35:04Z","pushed_at":"2015-10-01T23:41:55Z","git_url":"git://github.com/pillarjs/router.git","ssh_url":"git@github.com:pillarjs/router.git","clone_url":"https://github.com/pillarjs/router.git","svn_url":"https://github.com/pillarjs/router","homepage":"","size":820,"stargazers_count":46,"watchers_count":46,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":13,"mirror_url":null,"open_issues_count":11,"forks":13,"open_issues":11,"watchers":46,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pillarjs/router/pulls/25"},"html":{"href":"https://github.com/pillarjs/router/pull/25"},"issue":{"href":"https://api.github.com/repos/pillarjs/router/issues/25"},"comments":{"href":"https://api.github.com/repos/pillarjs/router/issues/25/comments"},"review_comments":{"href":"https://api.github.com/repos/pillarjs/router/pulls/25/comments"},"review_comment":{"href":"https://api.github.com/repos/pillarjs/router/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pillarjs/router/pulls/25/commits"},"statuses":{"href":"https://api.github.com/repos/pillarjs/router/statuses/f5a61453c89a55e49d7e5b4771affa1eabacb465"}}}}