{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/ecma262/issues/150","labels_url":"https://api.github.com/repos/tc39/ecma262/issues/150/labels{/name}","comments_url":"https://api.github.com/repos/tc39/ecma262/issues/150/comments","events_url":"https://api.github.com/repos/tc39/ecma262/issues/150/events","html_url":"https://github.com/tc39/ecma262/issues/150","id":114166139,"number":150,"title":"Annex B.3.5 CatchParameter legacy remedy could be narrower","user":{"login":"ajklein","id":1571484,"avatar_url":"https://avatars.githubusercontent.com/u/1571484?v=3","gravatar_id":"","url":"https://api.github.com/users/ajklein","html_url":"https://github.com/ajklein","followers_url":"https://api.github.com/users/ajklein/followers","following_url":"https://api.github.com/users/ajklein/following{/other_user}","gists_url":"https://api.github.com/users/ajklein/gists{/gist_id}","starred_url":"https://api.github.com/users/ajklein/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajklein/subscriptions","organizations_url":"https://api.github.com/users/ajklein/orgs","repos_url":"https://api.github.com/users/ajklein/repos","events_url":"https://api.github.com/users/ajklein/events{/privacy}","received_events_url":"https://api.github.com/users/ajklein/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-29T23:09:54Z","updated_at":"2015-10-30T15:52:29Z","closed_at":null,"body":"The [early errors](http://tc39.github.io/ecma262/#sec-try-statement-static-semantics-early-errors) for Try/Catch names includes the following passage:\r\n\r\n\"It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the VarDeclaredNames of Block.\"\r\n\r\nHowever, this is modified in [B.3.5](http://tc39.github.io/ecma262/#sec-variablestatements-in-catch-blocks) to allow code of the form:\r\n\r\n```js\r\ntry {\r\n  ...\r\n} catch (e) {\r\n  var e = 2;\r\n}\r\n```\r\n\r\nto run without complaint, presumably for legacy compat reasons. The spec text says:\r\n\r\n\"It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the VarDeclaredNames of Block, unless that element is only bound by a VariableStatement or the VariableDeclarationList of a for statement, or the ForBinding of a for-in statement.\"\r\n\r\nBut this means that the following is also allowed:\r\n\r\n```js\r\ntry {\r\n  ...\r\n} catch ({stack, code}) {\r\n  var stack = 1;\r\n  var code = 2;\r\n}\r\n```\r\n\r\nWhat's the motivation for allowing the destructured form, given that there will be no legacy concerns in that case? One could imagine the spec could instead read:\r\n\r\n\"It is a Syntax Error if any element of the BoundNames of CatchParameter also occurs in the VarDeclaredNames of Block, unless _BoundNames contains a single element and_ that element is only bound by a VariableStatement or the VariableDeclarationList of a for statement, or the ForBinding of a for-in statement.\""},"comment":{"url":"https://api.github.com/repos/tc39/ecma262/issues/comments/152563652","html_url":"https://github.com/tc39/ecma262/issues/150#issuecomment-152563652","issue_url":"https://api.github.com/repos/tc39/ecma262/issues/150","id":152563652,"user":{"login":"michaelficarra","id":218840,"avatar_url":"https://avatars.githubusercontent.com/u/218840?v=3","gravatar_id":"","url":"https://api.github.com/users/michaelficarra","html_url":"https://github.com/michaelficarra","followers_url":"https://api.github.com/users/michaelficarra/followers","following_url":"https://api.github.com/users/michaelficarra/following{/other_user}","gists_url":"https://api.github.com/users/michaelficarra/gists{/gist_id}","starred_url":"https://api.github.com/users/michaelficarra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michaelficarra/subscriptions","organizations_url":"https://api.github.com/users/michaelficarra/orgs","repos_url":"https://api.github.com/users/michaelficarra/repos","events_url":"https://api.github.com/users/michaelficarra/events{/privacy}","received_events_url":"https://api.github.com/users/michaelficarra/received_events","type":"User","site_admin":false},"created_at":"2015-10-30T15:52:29Z","updated_at":"2015-10-30T15:52:29Z","body":"Yes, that final change should do it."}}