{"action":"created","issue":{"url":"https://api.github.com/repos/opal/opal/issues/1305","labels_url":"https://api.github.com/repos/opal/opal/issues/1305/labels{/name}","comments_url":"https://api.github.com/repos/opal/opal/issues/1305/comments","events_url":"https://api.github.com/repos/opal/opal/issues/1305/events","html_url":"https://github.com/opal/opal/issues/1305","id":128870654,"number":1305,"title":"SyntaxError: `return try {`","user":{"login":"vais","id":77592,"avatar_url":"https://avatars.githubusercontent.com/u/77592?v=3","gravatar_id":"","url":"https://api.github.com/users/vais","html_url":"https://github.com/vais","followers_url":"https://api.github.com/users/vais/followers","following_url":"https://api.github.com/users/vais/following{/other_user}","gists_url":"https://api.github.com/users/vais/gists{/gist_id}","starred_url":"https://api.github.com/users/vais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vais/subscriptions","organizations_url":"https://api.github.com/users/vais/orgs","repos_url":"https://api.github.com/users/vais/repos","events_url":"https://api.github.com/users/vais/events{/privacy}","received_events_url":"https://api.github.com/users/vais/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-01-26T16:27:39Z","updated_at":"2016-01-26T17:10:25Z","closed_at":null,"body":"The following Ruby:\r\n```ruby\r\n  it \"can be used to handle a specific exception\" do\r\n    begin\r\n      raise SpecificExampleException, \"Raising this to be handled below\"\r\n    rescue SpecificExampleException\r\n      :caught\r\n    end.should == :caught\r\n  end\r\n```\r\ncompiles to the following JavaScript:\r\n```javascript\r\n($a = ($c = self).$it, $a.$$p = (TMP_3 = function(){var self = TMP_3.$$s || this;\r\n    return try {\r\n        return self.$raise($scope.get('SpecificExampleException'), \"Raising this to be handled below\")\r\n      } catch ($err) {\r\n        if (Opal.rescue($err, [$scope.get('SpecificExampleException')])) {\r\n          try {\r\n            return \"caught\"\r\n          } finally { Opal.pop_exception() }\r\n        } else { throw $err; }\r\n      }.$should()['$=='](\"caught\")}, TMP_3.$$s = self, TMP_3), $a).call($c, \"can be used to handle a specific exception\");\r\n```\r\nwhich, when executed, produces a SyntaxError:\r\n```\r\n    return try {\r\n           ^^^\r\n\r\nSyntaxError: Unexpected token try\r\n    at exports.runInThisContext (vm.js:53:16)\r\n    at Module._compile (module.js:374:25)\r\n    at Object.Module._extensions..js (module.js:417:10)\r\n    at Module.load (module.js:344:32)\r\n    at Function.Module._load (module.js:301:12)\r\n    at Function.Module.runMain (module.js:442:10)\r\n    at startup (node.js:136:18)\r\n    at node.js:966:3\r\n```\r\nDue to this issue, we can no longer execute https://github.com/ruby/spec/blob/master/language/rescue_spec.rb#L17"},"comment":{"url":"https://api.github.com/repos/opal/opal/issues/comments/175121761","html_url":"https://github.com/opal/opal/issues/1305#issuecomment-175121761","issue_url":"https://api.github.com/repos/opal/opal/issues/1305","id":175121761,"user":{"login":"elia","id":1051,"avatar_url":"https://avatars.githubusercontent.com/u/1051?v=3","gravatar_id":"","url":"https://api.github.com/users/elia","html_url":"https://github.com/elia","followers_url":"https://api.github.com/users/elia/followers","following_url":"https://api.github.com/users/elia/following{/other_user}","gists_url":"https://api.github.com/users/elia/gists{/gist_id}","starred_url":"https://api.github.com/users/elia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elia/subscriptions","organizations_url":"https://api.github.com/users/elia/orgs","repos_url":"https://api.github.com/users/elia/repos","events_url":"https://api.github.com/users/elia/events{/privacy}","received_events_url":"https://api.github.com/users/elia/received_events","type":"User","site_admin":false},"created_at":"2016-01-26T17:10:25Z","updated_at":"2016-01-26T17:10:25Z","body":"My understanding is that if I run the travis build on master it would now fail, because part of the build process is to `bundle update` thus updating `mspec` to the latest commit, producing the errors we both saw. The change I'm referring to is this:\r\n\r\nhttps://github.com/ruby/mspec/commit/7a19a5997aa313fe0faf7ff6f2edba1cecb44654\r\n\r\nwhich \"forbids\" using `should_not raise_error` (which is good btw).\r\n\r\n---\r\n\r\nWhat I suggest is to add mspec as a submodule and use a version prior to that change, and then take our time to sort out the new `rescue` bug before upgrading `ruby/spec` and `ruby/mspec`."}}