{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/90135919","pull_request_review_id":10660073,"id":90135919,"diff_hunk":"@@ -10110,9 +10110,79 @@ ParseNodePtr Parser::ParseStatement()\n LDefaultToken:\n     default:\n     {\n-        // An expression statement or a label.\n-        IdentToken tokInner;\n-        pnode = ParseExpr<buildAST>(koplNo, nullptr, TRUE, FALSE, nullptr, nullptr /*hintLength*/, nullptr /*hintOffset*/, &tokInner);\n+        // First check for a label via lookahead. If not found,\n+        // rewind and reparse as expression statement.\n+        if (m_token.tk == tkLParen || m_token.tk == tkID)\n+        {\n+            RestorePoint idStart;\n+            m_pscan->Capture(&idStart);\n+\n+            // Support legacy behavior of allowing parentheses around label identifiers.\n+            // Require balanced parentheses for correcting parsing.  Note unbalanced cases\n+            // take care of themselves correctly by resulting in rewind and parsing as\n+            // an expression statement.\n+            // REVIEW[ianhall]: Can this legacy functionality be removed? Chrome does not support this parsing behavior.","path":"lib/Parser/Parse.cpp","position":27,"original_position":27,"commit_id":"4ff96d896009df86cb84b0c09fd1ab218ee628be","original_commit_id":"4ff96d896009df86cb84b0c09fd1ab218ee628be","user":{"login":"akroshg","id":13008822,"avatar_url":"https://avatars.githubusercontent.com/u/13008822?v=3","gravatar_id":"","url":"https://api.github.com/users/akroshg","html_url":"https://github.com/akroshg","followers_url":"https://api.github.com/users/akroshg/followers","following_url":"https://api.github.com/users/akroshg/following{/other_user}","gists_url":"https://api.github.com/users/akroshg/gists{/gist_id}","starred_url":"https://api.github.com/users/akroshg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/akroshg/subscriptions","organizations_url":"https://api.github.com/users/akroshg/orgs","repos_url":"https://api.github.com/users/akroshg/repos","events_url":"https://api.github.com/users/akroshg/events{/privacy}","received_events_url":"https://api.github.com/users/akroshg/received_events","type":"User","site_admin":false},"body":"We should remove this legacy behavior. (I didn't even know this was existed)","created_at":"2016-11-29T23:06:23Z","updated_at":"2016-11-29T23:06:23Z","html_url":"https://github.com/Microsoft/ChakraCore/pull/2115#discussion_r90135919","pull_request_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/90135919"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/2115#discussion_r90135919"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115","id":95791582,"html_url":"https://github.com/Microsoft/ChakraCore/pull/2115","diff_url":"https://github.com/Microsoft/ChakraCore/pull/2115.diff","patch_url":"https://github.com/Microsoft/ChakraCore/pull/2115.patch","issue_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2115","number":2115,"state":"open","locked":false,"title":"Fix crash due to label breaking precise captures","user":{"login":"ianwjhalliday","id":906649,"avatar_url":"https://avatars.githubusercontent.com/u/906649?v=3","gravatar_id":"","url":"https://api.github.com/users/ianwjhalliday","html_url":"https://github.com/ianwjhalliday","followers_url":"https://api.github.com/users/ianwjhalliday/followers","following_url":"https://api.github.com/users/ianwjhalliday/following{/other_user}","gists_url":"https://api.github.com/users/ianwjhalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwjhalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwjhalliday/subscriptions","organizations_url":"https://api.github.com/users/ianwjhalliday/orgs","repos_url":"https://api.github.com/users/ianwjhalliday/repos","events_url":"https://api.github.com/users/ianwjhalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ianwjhalliday/received_events","type":"User","site_admin":false},"body":"Precise closure capture breaks when a label exists with the same name as a variable or function.\r\n\r\nLabel parsing used to rely on ParseExpr(), checking after the fact to see if the expression was a single identifier and if it is followed by a tkColon. Since it parsed, however, a pidref was pushed for the identifier setting up a new reference to that identifier which could then trick the front-end into thinking there was a closure capture where there actually wasn't.  This leads to invalid StSlots and LdSlots.\r\n\r\nFix it by looking for a label before parsing as an expression statement. Labels are by spec exactly a tkID followed by a tkColon.  Chakra unfortunately allows parenthesized label names, so we also check for balanced open and close parentheses here to maintain that behavior.  We will remove this legacy behavior in a future release.\r\n\r\nIf we don't find a label pattern in the syntax then we rewind and parse as an expression statement.","created_at":"2016-11-29T22:43:06Z","updated_at":"2016-11-29T23:06:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"997165c0c7cc4b3c2cf6c88d80a92c2e3ef1ed7d","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115/commits","review_comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115/comments","review_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2115/comments","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/4ff96d896009df86cb84b0c09fd1ab218ee628be","head":{"label":"ianwjhalliday:fixlabel-withparensallowed","ref":"fixlabel-withparensallowed","sha":"4ff96d896009df86cb84b0c09fd1ab218ee628be","user":{"login":"ianwjhalliday","id":906649,"avatar_url":"https://avatars.githubusercontent.com/u/906649?v=3","gravatar_id":"","url":"https://api.github.com/users/ianwjhalliday","html_url":"https://github.com/ianwjhalliday","followers_url":"https://api.github.com/users/ianwjhalliday/followers","following_url":"https://api.github.com/users/ianwjhalliday/following{/other_user}","gists_url":"https://api.github.com/users/ianwjhalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwjhalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwjhalliday/subscriptions","organizations_url":"https://api.github.com/users/ianwjhalliday/orgs","repos_url":"https://api.github.com/users/ianwjhalliday/repos","events_url":"https://api.github.com/users/ianwjhalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ianwjhalliday/received_events","type":"User","site_admin":false},"repo":{"id":49596782,"name":"ChakraCore","full_name":"ianwjhalliday/ChakraCore","owner":{"login":"ianwjhalliday","id":906649,"avatar_url":"https://avatars.githubusercontent.com/u/906649?v=3","gravatar_id":"","url":"https://api.github.com/users/ianwjhalliday","html_url":"https://github.com/ianwjhalliday","followers_url":"https://api.github.com/users/ianwjhalliday/followers","following_url":"https://api.github.com/users/ianwjhalliday/following{/other_user}","gists_url":"https://api.github.com/users/ianwjhalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwjhalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwjhalliday/subscriptions","organizations_url":"https://api.github.com/users/ianwjhalliday/orgs","repos_url":"https://api.github.com/users/ianwjhalliday/repos","events_url":"https://api.github.com/users/ianwjhalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ianwjhalliday/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ianwjhalliday/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":true,"url":"https://api.github.com/repos/ianwjhalliday/ChakraCore","forks_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/forks","keys_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/teams","hooks_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/events","assignees_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/tags","blobs_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/subscription","commits_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/merges","archive_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/downloads","issues_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/ianwjhalliday/ChakraCore/deployments","created_at":"2016-01-13T19:33:09Z","updated_at":"2016-11-15T03:02:30Z","pushed_at":"2016-11-29T22:41:18Z","git_url":"git://github.com/ianwjhalliday/ChakraCore.git","ssh_url":"git@github.com:ianwjhalliday/ChakraCore.git","clone_url":"https://github.com/ianwjhalliday/ChakraCore.git","svn_url":"https://github.com/ianwjhalliday/ChakraCore","homepage":null,"size":49415,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Microsoft:release/1.4","ref":"release/1.4","sha":"140947b52b3d6081e7b3b74243ac8c0b0777c13c","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":49086513,"name":"ChakraCore","full_name":"Microsoft/ChakraCore","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":false,"url":"https://api.github.com/repos/Microsoft/ChakraCore","forks_url":"https://api.github.com/repos/Microsoft/ChakraCore/forks","keys_url":"https://api.github.com/repos/Microsoft/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/ChakraCore/teams","hooks_url":"https://api.github.com/repos/Microsoft/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/events","assignees_url":"https://api.github.com/repos/Microsoft/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/tags","blobs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/Microsoft/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscription","commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/ChakraCore/merges","archive_url":"https://api.github.com/repos/Microsoft/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/ChakraCore/downloads","issues_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/ChakraCore/deployments","created_at":"2016-01-05T19:05:31Z","updated_at":"2016-11-29T22:29:00Z","pushed_at":"2016-11-29T23:00:01Z","git_url":"git://github.com/Microsoft/ChakraCore.git","ssh_url":"git@github.com:Microsoft/ChakraCore.git","clone_url":"https://github.com/Microsoft/ChakraCore.git","svn_url":"https://github.com/Microsoft/ChakraCore","homepage":null,"size":63341,"stargazers_count":5785,"watchers_count":5785,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":663,"mirror_url":null,"open_issues_count":195,"forks":663,"open_issues":195,"watchers":5785,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/2115"},"issue":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2115"},"comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/2115/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/2115/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/4ff96d896009df86cb84b0c09fd1ab218ee628be"}}}}
{"actor":{"display_login":"akroshg"}}