{"action":"created","issue":{"url":"https://api.github.com/repos/infernojs/inferno/issues/645","repository_url":"https://api.github.com/repos/infernojs/inferno","labels_url":"https://api.github.com/repos/infernojs/inferno/issues/645/labels{/name}","comments_url":"https://api.github.com/repos/infernojs/inferno/issues/645/comments","events_url":"https://api.github.com/repos/infernojs/inferno/issues/645/events","html_url":"https://github.com/infernojs/inferno/pull/645","id":197759288,"number":645,"title":"fix router bug","user":{"login":"degroote22","id":12750442,"avatar_url":"https://avatars.githubusercontent.com/u/12750442?v=3","gravatar_id":"","url":"https://api.github.com/users/degroote22","html_url":"https://github.com/degroote22","followers_url":"https://api.github.com/users/degroote22/followers","following_url":"https://api.github.com/users/degroote22/following{/other_user}","gists_url":"https://api.github.com/users/degroote22/gists{/gist_id}","starred_url":"https://api.github.com/users/degroote22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/degroote22/subscriptions","organizations_url":"https://api.github.com/users/degroote22/orgs","repos_url":"https://api.github.com/users/degroote22/repos","events_url":"https://api.github.com/users/degroote22/events{/privacy}","received_events_url":"https://api.github.com/users/degroote22/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-12-27T21:19:35Z","updated_at":"2016-12-27T21:22:08Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/infernojs/inferno/pulls/645","html_url":"https://github.com/infernojs/inferno/pull/645","diff_url":"https://github.com/infernojs/inferno/pull/645.diff","patch_url":"https://github.com/infernojs/inferno/pull/645.patch"},"body":"This\r\n```\r\nreturn diff || (bAttr.path && aAttr.path) ? (bAttr.path.length - aAttr.path.length) : 0\r\n```\r\nis being interpreted as\r\n```\r\nreturn (diff || (bAttr.path && aAttr.path)) ? (bAttr.path.length - aAttr.path.length) : 0\r\n```\r\nnot\r\n```\r\nreturn diff || ((bAttr.path && aAttr.path) ? (bAttr.path.length - aAttr.path.length) : 0)\r\n```\r\nand then I get the error that it cant read length of undefined.\r\n\r\nThe router would only bug if i had two routes like this\r\n\r\n- /5char\r\n\r\n- /fivec/:foo\r\n\r\nIt was 5 chars that broke but from what I could read of the code any length would bug the sorting."},"comment":{"url":"https://api.github.com/repos/infernojs/inferno/issues/comments/269384468","html_url":"https://github.com/infernojs/inferno/pull/645#issuecomment-269384468","issue_url":"https://api.github.com/repos/infernojs/inferno/issues/645","id":269384468,"user":{"login":"degroote22","id":12750442,"avatar_url":"https://avatars.githubusercontent.com/u/12750442?v=3","gravatar_id":"","url":"https://api.github.com/users/degroote22","html_url":"https://github.com/degroote22","followers_url":"https://api.github.com/users/degroote22/followers","following_url":"https://api.github.com/users/degroote22/following{/other_user}","gists_url":"https://api.github.com/users/degroote22/gists{/gist_id}","starred_url":"https://api.github.com/users/degroote22/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/degroote22/subscriptions","organizations_url":"https://api.github.com/users/degroote22/orgs","repos_url":"https://api.github.com/users/degroote22/repos","events_url":"https://api.github.com/users/degroote22/events{/privacy}","received_events_url":"https://api.github.com/users/degroote22/received_events","type":"User","site_admin":false},"created_at":"2016-12-27T21:22:08Z","updated_at":"2016-12-27T21:22:08Z","body":"Also, this bug was brought up because writing multiple || and && does this kind of stuff.\r\nThere is a linting rule that prevent this: http://eslint.org/docs/rules/no-mixed-operators\r\nWhat do you think about adopting this one and writing this kind of logic more clearly?\r\nAlso, what would be a performant way to write it like so?"}}
{"actor":{"display_login":"degroote22"}}