{"action":"closed","issue":{"url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23835","repository_url":"https://api.github.com/repos/Microsoft/TypeScript","labels_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23835/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23835/comments","events_url":"https://api.github.com/repos/Microsoft/TypeScript/issues/23835/events","html_url":"https://github.com/Microsoft/TypeScript/issues/23835","id":319710343,"number":23835,"title":"Some JavaScript syntax error only shown in TypeScript files","user":{"login":"billti","id":993909,"avatar_url":"https://avatars3.githubusercontent.com/u/993909?v=4","gravatar_id":"","url":"https://api.github.com/users/billti","html_url":"https://github.com/billti","followers_url":"https://api.github.com/users/billti/followers","following_url":"https://api.github.com/users/billti/following{/other_user}","gists_url":"https://api.github.com/users/billti/gists{/gist_id}","starred_url":"https://api.github.com/users/billti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/billti/subscriptions","organizations_url":"https://api.github.com/users/billti/orgs","repos_url":"https://api.github.com/users/billti/repos","events_url":"https://api.github.com/users/billti/events{/privacy}","received_events_url":"https://api.github.com/users/billti/received_events","type":"User","site_admin":false},"labels":[{"id":113971226,"url":"https://api.github.com/repos/Microsoft/TypeScript/labels/Duplicate","name":"Duplicate","color":"f7c6c7","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-05-02T20:59:58Z","updated_at":"2018-05-18T19:46:06Z","closed_at":"2018-05-18T19:46:06Z","author_association":"MEMBER","body":"Given the below code\r\n\r\n```js\r\nfunction foo(){\r\n    var x = \"test\";\r\n    break;\r\n}\r\n```\r\n\r\nTypeScript files will return an error on the \"break\" statement, but JavaScript files will not.\r\n\r\nAccording to the ES5 spec (http://es5.github.io/#x12.8)\r\n\r\n> A program is considered syntactically incorrect if either of the following is true...\r\n>  - The program contains a break statement without the optional Identifier, which is not nested, directly or indirectly (but not crossing function boundaries), within an IterationStatement or a SwitchStatement\r\n\r\nLooks like this was fixed for TypeScript in https://github.com/Microsoft/TypeScript/issues/57 . We should give the same syntax errors in JavaScript files."}}
{"actor":{"display_login":"typescript-bot"}}