{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/238037261","pull_request_review_id":180493989,"id":238037261,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzODAzNzI2MQ==","diff_hunk":"@@ -66,16 +73,33 @@ module.exports = function(babel) {\n         // This might not be the case like in assertEnum which we currently\n         // don't remove.\n         const args = path.node.arguments[0];\n+        const type = typeMap[property.name];\n+\n         if (args) {\n           if (parenthesized) {\n             path.replaceWith(t.parenthesizedExpression(args));\n             path.skip();\n-          } else {\n+          // If is not an assert type, we won't need to do type annotation.\n+          // If it has no type that we can cast to, then we also won't need to\n+          // do type annotation.\n+          } else if (!/^assert/.test(property.name) || !type) {","path":"build-system/babel-plugins/babel-plugin-transform-amp-asserts/index.js","position":28,"original_position":28,"commit_id":"0a9bebfac94fa0790d8a55c0f578170c52acb66f","original_commit_id":"0a9bebfac94fa0790d8a55c0f578170c52acb66f","user":{"login":"jridgewell","id":112982,"node_id":"MDQ6VXNlcjExMjk4Mg==","avatar_url":"https://avatars1.githubusercontent.com/u/112982?v=4","gravatar_id":"","url":"https://api.github.com/users/jridgewell","html_url":"https://github.com/jridgewell","followers_url":"https://api.github.com/users/jridgewell/followers","following_url":"https://api.github.com/users/jridgewell/following{/other_user}","gists_url":"https://api.github.com/users/jridgewell/gists{/gist_id}","starred_url":"https://api.github.com/users/jridgewell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jridgewell/subscriptions","organizations_url":"https://api.github.com/users/jridgewell/orgs","repos_url":"https://api.github.com/users/jridgewell/repos","events_url":"https://api.github.com/users/jridgewell/events{/privacy}","received_events_url":"https://api.github.com/users/jridgewell/received_events","type":"User","site_admin":false},"body":"`!property.name.startsWith('assert')`","created_at":"2018-12-01T00:01:45Z","updated_at":"2018-12-01T00:03:02Z","html_url":"https://github.com/ampproject/amphtml/pull/19441#discussion_r238037261","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/19441","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/238037261"},"html":{"href":"https://github.com/ampproject/amphtml/pull/19441#discussion_r238037261"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/19441"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/19441","id":233433213,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMzNDMzMjEz","html_url":"https://github.com/ampproject/amphtml/pull/19441","diff_url":"https://github.com/ampproject/amphtml/pull/19441.diff","patch_url":"https://github.com/ampproject/amphtml/pull/19441.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/19441","number":19441,"state":"open","locked":false,"title":"while removing assert methods as a preprocess step, add back in the type","user":{"login":"erwinmombay","id":354746,"node_id":"MDQ6VXNlcjM1NDc0Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/354746?v=4","gravatar_id":"","url":"https://api.github.com/users/erwinmombay","html_url":"https://github.com/erwinmombay","followers_url":"https://api.github.com/users/erwinmombay/followers","following_url":"https://api.github.com/users/erwinmombay/following{/other_user}","gists_url":"https://api.github.com/users/erwinmombay/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinmombay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinmombay/subscriptions","organizations_url":"https://api.github.com/users/erwinmombay/orgs","repos_url":"https://api.github.com/users/erwinmombay/repos","events_url":"https://api.github.com/users/erwinmombay/events{/privacy}","received_events_url":"https://api.github.com/users/erwinmombay/received_events","type":"User","site_admin":false},"body":"when we remove assert methods as a preprocess step, this changes the type flow as `assert` methods do a type cast. We need to add the typecast annotation to replace the removed method.\r\n\r\nwe special case `null` literals passed into `assert` methods as they are sometimes used in abstract classes methods to enforce subclasses to implement.","created_at":"2018-11-26T04:08:13Z","updated_at":"2018-12-01T00:03:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0cf91b8435ce29cad137f12606805dfa8cb4ce1b","assignee":null,"assignees":[],"requested_reviewers":[{"login":"prateekbh","id":5960497,"node_id":"MDQ6VXNlcjU5NjA0OTc=","avatar_url":"https://avatars2.githubusercontent.com/u/5960497?v=4","gravatar_id":"","url":"https://api.github.com/users/prateekbh","html_url":"https://github.com/prateekbh","followers_url":"https://api.github.com/users/prateekbh/followers","following_url":"https://api.github.com/users/prateekbh/following{/other_user}","gists_url":"https://api.github.com/users/prateekbh/gists{/gist_id}","starred_url":"https://api.github.com/users/prateekbh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prateekbh/subscriptions","organizations_url":"https://api.github.com/users/prateekbh/orgs","repos_url":"https://api.github.com/users/prateekbh/repos","events_url":"https://api.github.com/users/prateekbh/events{/privacy}","received_events_url":"https://api.github.com/users/prateekbh/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":284925157,"node_id":"MDU6TGFiZWwyODQ5MjUxNTc=","url":"https://api.github.com/repos/ampproject/amphtml/labels/Category:%20Tooling","name":"Category: Tooling","color":"1d76db","default":false},{"id":596633554,"node_id":"MDU6TGFiZWw1OTY2MzM1NTQ=","url":"https://api.github.com/repos/ampproject/amphtml/labels/cla:%20yes","name":"cla: yes","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/19441/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/19441/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/19441/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/0a9bebfac94fa0790d8a55c0f578170c52acb66f","head":{"label":"erwinmombay:dce-asserts","ref":"dce-asserts","sha":"0a9bebfac94fa0790d8a55c0f578170c52acb66f","user":{"login":"erwinmombay","id":354746,"node_id":"MDQ6VXNlcjM1NDc0Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/354746?v=4","gravatar_id":"","url":"https://api.github.com/users/erwinmombay","html_url":"https://github.com/erwinmombay","followers_url":"https://api.github.com/users/erwinmombay/followers","following_url":"https://api.github.com/users/erwinmombay/following{/other_user}","gists_url":"https://api.github.com/users/erwinmombay/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinmombay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinmombay/subscriptions","organizations_url":"https://api.github.com/users/erwinmombay/orgs","repos_url":"https://api.github.com/users/erwinmombay/repos","events_url":"https://api.github.com/users/erwinmombay/events{/privacy}","received_events_url":"https://api.github.com/users/erwinmombay/received_events","type":"User","site_admin":false},"repo":{"id":43843790,"node_id":"MDEwOlJlcG9zaXRvcnk0Mzg0Mzc5MA==","name":"amphtml","full_name":"erwinmombay/amphtml","private":false,"owner":{"login":"erwinmombay","id":354746,"node_id":"MDQ6VXNlcjM1NDc0Ng==","avatar_url":"https://avatars1.githubusercontent.com/u/354746?v=4","gravatar_id":"","url":"https://api.github.com/users/erwinmombay","html_url":"https://github.com/erwinmombay","followers_url":"https://api.github.com/users/erwinmombay/followers","following_url":"https://api.github.com/users/erwinmombay/following{/other_user}","gists_url":"https://api.github.com/users/erwinmombay/gists{/gist_id}","starred_url":"https://api.github.com/users/erwinmombay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erwinmombay/subscriptions","organizations_url":"https://api.github.com/users/erwinmombay/orgs","repos_url":"https://api.github.com/users/erwinmombay/repos","events_url":"https://api.github.com/users/erwinmombay/events{/privacy}","received_events_url":"https://api.github.com/users/erwinmombay/received_events","type":"User","site_admin":false},"html_url":"https://github.com/erwinmombay/amphtml","description":null,"fork":true,"url":"https://api.github.com/repos/erwinmombay/amphtml","forks_url":"https://api.github.com/repos/erwinmombay/amphtml/forks","keys_url":"https://api.github.com/repos/erwinmombay/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erwinmombay/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erwinmombay/amphtml/teams","hooks_url":"https://api.github.com/repos/erwinmombay/amphtml/hooks","issue_events_url":"https://api.github.com/repos/erwinmombay/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/erwinmombay/amphtml/events","assignees_url":"https://api.github.com/repos/erwinmombay/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/erwinmombay/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/erwinmombay/amphtml/tags","blobs_url":"https://api.github.com/repos/erwinmombay/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erwinmombay/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erwinmombay/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/erwinmombay/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erwinmombay/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/erwinmombay/amphtml/languages","stargazers_url":"https://api.github.com/repos/erwinmombay/amphtml/stargazers","contributors_url":"https://api.github.com/repos/erwinmombay/amphtml/contributors","subscribers_url":"https://api.github.com/repos/erwinmombay/amphtml/subscribers","subscription_url":"https://api.github.com/repos/erwinmombay/amphtml/subscription","commits_url":"https://api.github.com/repos/erwinmombay/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/erwinmombay/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/erwinmombay/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/erwinmombay/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/erwinmombay/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/erwinmombay/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erwinmombay/amphtml/merges","archive_url":"https://api.github.com/repos/erwinmombay/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erwinmombay/amphtml/downloads","issues_url":"https://api.github.com/repos/erwinmombay/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/erwinmombay/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/erwinmombay/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/erwinmombay/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erwinmombay/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/erwinmombay/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/erwinmombay/amphtml/deployments","created_at":"2015-10-07T20:45:56Z","updated_at":"2018-06-11T18:26:03Z","pushed_at":"2018-11-30T18:49:23Z","git_url":"git://github.com/erwinmombay/amphtml.git","ssh_url":"git@github.com:erwinmombay/amphtml.git","clone_url":"https://github.com/erwinmombay/amphtml.git","svn_url":"https://github.com/erwinmombay/amphtml","homepage":"","size":602406,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":2,"watchers":0,"default_branch":"master"}},"base":{"label":"ampproject:master","ref":"master","sha":"5e6c958fb790befe5d3c7ba57905fbcab5155517","user":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"repo":{"id":41766002,"node_id":"MDEwOlJlcG9zaXRvcnk0MTc2NjAwMg==","name":"amphtml","full_name":"ampproject/amphtml","private":false,"owner":{"login":"ampproject","id":14114390,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE0MTE0Mzkw","avatar_url":"https://avatars3.githubusercontent.com/u/14114390?v=4","gravatar_id":"","url":"https://api.github.com/users/ampproject","html_url":"https://github.com/ampproject","followers_url":"https://api.github.com/users/ampproject/followers","following_url":"https://api.github.com/users/ampproject/following{/other_user}","gists_url":"https://api.github.com/users/ampproject/gists{/gist_id}","starred_url":"https://api.github.com/users/ampproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ampproject/subscriptions","organizations_url":"https://api.github.com/users/ampproject/orgs","repos_url":"https://api.github.com/users/ampproject/repos","events_url":"https://api.github.com/users/ampproject/events{/privacy}","received_events_url":"https://api.github.com/users/ampproject/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/ampproject/amphtml","description":"AMP HTML source code, samples, and documentation.  See below for more info.","fork":false,"url":"https://api.github.com/repos/ampproject/amphtml","forks_url":"https://api.github.com/repos/ampproject/amphtml/forks","keys_url":"https://api.github.com/repos/ampproject/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ampproject/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ampproject/amphtml/teams","hooks_url":"https://api.github.com/repos/ampproject/amphtml/hooks","issue_events_url":"https://api.github.com/repos/ampproject/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/ampproject/amphtml/events","assignees_url":"https://api.github.com/repos/ampproject/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/ampproject/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/ampproject/amphtml/tags","blobs_url":"https://api.github.com/repos/ampproject/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ampproject/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ampproject/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/ampproject/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/ampproject/amphtml/languages","stargazers_url":"https://api.github.com/repos/ampproject/amphtml/stargazers","contributors_url":"https://api.github.com/repos/ampproject/amphtml/contributors","subscribers_url":"https://api.github.com/repos/ampproject/amphtml/subscribers","subscription_url":"https://api.github.com/repos/ampproject/amphtml/subscription","commits_url":"https://api.github.com/repos/ampproject/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/ampproject/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/ampproject/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/ampproject/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/ampproject/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/ampproject/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ampproject/amphtml/merges","archive_url":"https://api.github.com/repos/ampproject/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ampproject/amphtml/downloads","issues_url":"https://api.github.com/repos/ampproject/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/ampproject/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/ampproject/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/ampproject/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ampproject/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/ampproject/amphtml/releases{/id}","deployments_url":"https://api.github.com/repos/ampproject/amphtml/deployments","created_at":"2015-09-01T22:10:53Z","updated_at":"2018-11-30T23:21:17Z","pushed_at":"2018-11-30T23:23:40Z","git_url":"git://github.com/ampproject/amphtml.git","ssh_url":"git@github.com:ampproject/amphtml.git","clone_url":"https://github.com/ampproject/amphtml.git","svn_url":"https://github.com/ampproject/amphtml","homepage":"https://www.ampproject.org","size":564909,"stargazers_count":12217,"watchers_count":12217,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":2718,"mirror_url":null,"archived":false,"open_issues_count":1535,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":2718,"open_issues":1535,"watchers":12217,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/19441"},"html":{"href":"https://github.com/ampproject/amphtml/pull/19441"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/19441"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/19441/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/19441/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/19441/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/0a9bebfac94fa0790d8a55c0f578170c52acb66f"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"jridgewell"}}