{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/5049","repository_url":"https://api.github.com/repos/jashkenas/coffeescript","labels_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/5049/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/5049/comments","events_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/5049/events","html_url":"https://github.com/jashkenas/coffeescript/pull/5049","id":319545683,"number":5049,"title":"Fix #5046: Adjacent JSX","user":{"login":"zdenko","id":1264173,"avatar_url":"https://avatars2.githubusercontent.com/u/1264173?v=4","gravatar_id":"","url":"https://api.github.com/users/zdenko","html_url":"https://github.com/zdenko","followers_url":"https://api.github.com/users/zdenko/followers","following_url":"https://api.github.com/users/zdenko/following{/other_user}","gists_url":"https://api.github.com/users/zdenko/gists{/gist_id}","starred_url":"https://api.github.com/users/zdenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdenko/subscriptions","organizations_url":"https://api.github.com/users/zdenko/orgs","repos_url":"https://api.github.com/users/zdenko/repos","events_url":"https://api.github.com/users/zdenko/events{/privacy}","received_events_url":"https://api.github.com/users/zdenko/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-05-02T13:10:02Z","updated_at":"2018-05-02T17:02:31Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/jashkenas/coffeescript/pulls/5049","html_url":"https://github.com/jashkenas/coffeescript/pull/5049","diff_url":"https://github.com/jashkenas/coffeescript/pull/5049.diff","patch_url":"https://github.com/jashkenas/coffeescript/pull/5049.patch"},"body":"<!--\r\nBefore making a PR please make sure to read our contributing guidelines:\r\nhttp://coffeescript.org/#contributing\r\n\r\nFor issue references: Add a comma-separated list of a \r\n[closing word](https://help.github.com/articles/closing-issues-via-commit-messages/) followed by \r\nthe ticket number fixed by the PR. It should be underlined in the preview if done correctly.\r\n\r\nAll new features require tests. All but the most trivial bug fixes should also have new or updated tests.\r\n\r\nEnsure that all new code you add to the compiler can be run in the minimum version of Node listed in \r\n`package.json`. New tests can require newer Node runtimes, but you may need to ensure that such tests\r\nonly run in supported runtimes; see `Cakefile` for examples of how to filter out certain tests in \r\nruntimes that don’t support them.\r\n\r\nPlease follow the code style of the rest of the CoffeeScript codebase. Write comments in complete\r\nsentences using Markdown, as the comments become the [annotated source](http://coffeescript.org/#annotated-source).\r\nFor tests proving a bug is fixed, please mention the issue number in the test description (see examples\r\nin the codebase).\r\n\r\nDescribe your changes below in as much detail as possible.\r\n-->\r\nFixes the issue in previous PR (#5046).\r\nIn `Block::makeReturn`, the last two expressions are checked before the main loop starts.\r\nInstead of `unwrapAll()`, I used `unwrap()` to avoid false errors with `foo <a></a>` and when explicit `return` is used.\r\n\r\n```coffeescript\r\n<a></a>\r\nfoo <b></b>\r\n###\r\n<a></a>;\r\nfoo(<b></b>);\r\n###\r\n```\r\n---\r\n```coffeescript\r\nrender = ->\r\n  <a></a>\r\n  return <b></b>\r\n###\r\nrender = function() {\r\n  <a></a>;\r\n  return <b></b>;\r\n};\r\n###\r\n```"},"comment":{"url":"https://api.github.com/repos/jashkenas/coffeescript/issues/comments/386048857","html_url":"https://github.com/jashkenas/coffeescript/pull/5049#issuecomment-386048857","issue_url":"https://api.github.com/repos/jashkenas/coffeescript/issues/5049","id":386048857,"user":{"login":"zdenko","id":1264173,"avatar_url":"https://avatars2.githubusercontent.com/u/1264173?v=4","gravatar_id":"","url":"https://api.github.com/users/zdenko","html_url":"https://github.com/zdenko","followers_url":"https://api.github.com/users/zdenko/followers","following_url":"https://api.github.com/users/zdenko/following{/other_user}","gists_url":"https://api.github.com/users/zdenko/gists{/gist_id}","starred_url":"https://api.github.com/users/zdenko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdenko/subscriptions","organizations_url":"https://api.github.com/users/zdenko/orgs","repos_url":"https://api.github.com/users/zdenko/repos","events_url":"https://api.github.com/users/zdenko/events{/privacy}","received_events_url":"https://api.github.com/users/zdenko/received_events","type":"User","site_admin":false},"created_at":"2018-05-02T17:02:31Z","updated_at":"2018-05-02T17:02:31Z","author_association":"COLLABORATOR","body":"OK, So only JSX in parentheses should throw an error?\r\n\r\n```coffeescript\r\nrender = -> (\r\n  <Row>ABC</Row>\r\n  <Row>DEF</Row>\r\n)\r\n```\r\n\r\nSince CS [removes](http://coffeescript.org/#try:foo%20%3D%20-%3E%20(%0A%20%20%20a%0A%20%20%20b%0A)) parentheses in any case, JSX will get special treatment.\r\n\r\nAnd, what about this case?\r\n\r\n```coffeescript\r\nrender = -> (\r\n  a += 1\r\n  <Row>ABC</Row>\r\n  <Row>DEF</Row>\r\n)\r\n```\r\n\r\nI guess we could inspect expressions in the parentheses and only if JSX is present we would throw an error."}}
{"actor":{"display_login":"zdenko"}}