{"action":"created","comment":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/48202514","id":48202514,"diff_hunk":"@@ -123,3 +123,51 @@ export function validateSrcContains(string, src) {\n     throw new Error('Invalid src ' + src);\n   }\n }\n+\n+/**\n+ * Throws a non-interrupting exception if data contains a field not supported\n+ * by this embed type.\n+ * @param {!Object} data\n+ * @param {!Array<string>} allowedFields\n+ */\n+export function checkData(data, allowedFields) {\n+  // Throw in a timeout, because we do not want to interrupt execution,\n+  // because that would make each removal an instant backward incompatible\n+  // change.\n+  try {\n+    validateData(data, allowedFields);\n+  } catch (e) {\n+    setTimeout(() => {\n+      throw e;\n+    });\n+  }\n+}\n+\n+/**\n+ * Throws an exception if data contains a field not supported\n+ * by this embed type.\n+ * @param {!Object} data\n+ * @param {!Array<string>} allowedFields\n+ */\n+export function validateData(data, allowedFields) {\n+  const defaults = {","path":"src/3p.js","position":null,"original_position":31,"commit_id":"fda10821aa06f1468d7e3dda8aa8e527ccbc78dc","original_commit_id":"d83f02da454fb453b10d8492ed79fa4563e503e2","user":{"login":"erwinmombay","id":354746,"avatar_url":"https://avatars.githubusercontent.com/u/354746?v=3","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":"sgtm. :+1: ","created_at":"2015-12-21T22:51:25Z","updated_at":"2015-12-21T22:51:25Z","html_url":"https://github.com/ampproject/amphtml/pull/1211#discussion_r48202514","pull_request_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1211","_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments/48202514"},"html":{"href":"https://github.com/ampproject/amphtml/pull/1211#discussion_r48202514"},"pull_request":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1211"}}},"pull_request":{"url":"https://api.github.com/repos/ampproject/amphtml/pulls/1211","id":54299816,"html_url":"https://github.com/ampproject/amphtml/pull/1211","diff_url":"https://github.com/ampproject/amphtml/pull/1211.diff","patch_url":"https://github.com/ampproject/amphtml/pull/1211.patch","issue_url":"https://api.github.com/repos/ampproject/amphtml/issues/1211","number":1211,"state":"closed","locked":false,"title":"Add a feature that checks arguments to 3p embeds","user":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"body":"… and throws if an unexpected argument appears.\r\n\r\nPreviously we would just silently ignore these,\r\nwhich leads to very hard to debug errors. Especially since these are often\r\noptional. The new errors do not interrupt execution to avoid each deprecation\r\nbeing a breaking change.\r\n\r\nUnrelated to the rest of the PR: makes the `amp-iframe` more robust against flakes.","created_at":"2015-12-21T20:35:08Z","updated_at":"2015-12-21T22:51:25Z","closed_at":"2015-12-21T22:36:16Z","merged_at":"2015-12-21T22:36:16Z","merge_commit_sha":"48e1fa7f5cade2bf14693bd247f7718fb53a237e","assignee":{"login":"jridgewell","id":112982,"avatar_url":"https://avatars.githubusercontent.com/u/112982?v=3","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},"milestone":null,"commits_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1211/commits","review_comments_url":"https://api.github.com/repos/ampproject/amphtml/pulls/1211/comments","review_comment_url":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ampproject/amphtml/issues/1211/comments","statuses_url":"https://api.github.com/repos/ampproject/amphtml/statuses/fda10821aa06f1468d7e3dda8aa8e527ccbc78dc","head":{"label":"cramforce:3p-args","ref":"3p-args","sha":"fda10821aa06f1468d7e3dda8aa8e527ccbc78dc","user":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"repo":{"id":43817601,"name":"amphtml","full_name":"cramforce/amphtml","owner":{"login":"cramforce","id":89679,"avatar_url":"https://avatars.githubusercontent.com/u/89679?v=3","gravatar_id":"","url":"https://api.github.com/users/cramforce","html_url":"https://github.com/cramforce","followers_url":"https://api.github.com/users/cramforce/followers","following_url":"https://api.github.com/users/cramforce/following{/other_user}","gists_url":"https://api.github.com/users/cramforce/gists{/gist_id}","starred_url":"https://api.github.com/users/cramforce/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cramforce/subscriptions","organizations_url":"https://api.github.com/users/cramforce/orgs","repos_url":"https://api.github.com/users/cramforce/repos","events_url":"https://api.github.com/users/cramforce/events{/privacy}","received_events_url":"https://api.github.com/users/cramforce/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cramforce/amphtml","description":"","fork":true,"url":"https://api.github.com/repos/cramforce/amphtml","forks_url":"https://api.github.com/repos/cramforce/amphtml/forks","keys_url":"https://api.github.com/repos/cramforce/amphtml/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cramforce/amphtml/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cramforce/amphtml/teams","hooks_url":"https://api.github.com/repos/cramforce/amphtml/hooks","issue_events_url":"https://api.github.com/repos/cramforce/amphtml/issues/events{/number}","events_url":"https://api.github.com/repos/cramforce/amphtml/events","assignees_url":"https://api.github.com/repos/cramforce/amphtml/assignees{/user}","branches_url":"https://api.github.com/repos/cramforce/amphtml/branches{/branch}","tags_url":"https://api.github.com/repos/cramforce/amphtml/tags","blobs_url":"https://api.github.com/repos/cramforce/amphtml/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cramforce/amphtml/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cramforce/amphtml/git/refs{/sha}","trees_url":"https://api.github.com/repos/cramforce/amphtml/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cramforce/amphtml/statuses/{sha}","languages_url":"https://api.github.com/repos/cramforce/amphtml/languages","stargazers_url":"https://api.github.com/repos/cramforce/amphtml/stargazers","contributors_url":"https://api.github.com/repos/cramforce/amphtml/contributors","subscribers_url":"https://api.github.com/repos/cramforce/amphtml/subscribers","subscription_url":"https://api.github.com/repos/cramforce/amphtml/subscription","commits_url":"https://api.github.com/repos/cramforce/amphtml/commits{/sha}","git_commits_url":"https://api.github.com/repos/cramforce/amphtml/git/commits{/sha}","comments_url":"https://api.github.com/repos/cramforce/amphtml/comments{/number}","issue_comment_url":"https://api.github.com/repos/cramforce/amphtml/issues/comments{/number}","contents_url":"https://api.github.com/repos/cramforce/amphtml/contents/{+path}","compare_url":"https://api.github.com/repos/cramforce/amphtml/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cramforce/amphtml/merges","archive_url":"https://api.github.com/repos/cramforce/amphtml/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cramforce/amphtml/downloads","issues_url":"https://api.github.com/repos/cramforce/amphtml/issues{/number}","pulls_url":"https://api.github.com/repos/cramforce/amphtml/pulls{/number}","milestones_url":"https://api.github.com/repos/cramforce/amphtml/milestones{/number}","notifications_url":"https://api.github.com/repos/cramforce/amphtml/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cramforce/amphtml/labels{/name}","releases_url":"https://api.github.com/repos/cramforce/amphtml/releases{/id}","created_at":"2015-10-07T13:28:45Z","updated_at":"2015-10-07T13:28:46Z","pushed_at":"2015-12-21T22:43:01Z","git_url":"git://github.com/cramforce/amphtml.git","ssh_url":"git@github.com:cramforce/amphtml.git","clone_url":"https://github.com/cramforce/amphtml.git","svn_url":"https://github.com/cramforce/amphtml","homepage":"","size":13974,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"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":"ampproject:master","ref":"master","sha":"7b29c8858f9348bcaf613699ad01ba544a4bf389","user":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","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,"name":"amphtml","full_name":"ampproject/amphtml","owner":{"login":"ampproject","id":14114390,"avatar_url":"https://avatars.githubusercontent.com/u/14114390?v=3","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},"private":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}","created_at":"2015-09-01T22:10:53Z","updated_at":"2015-12-21T19:41:02Z","pushed_at":"2015-12-21T22:43:02Z","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://ampproject.org","size":15872,"stargazers_count":5086,"watchers_count":5086,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":498,"mirror_url":null,"open_issues_count":180,"forks":498,"open_issues":180,"watchers":5086,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1211"},"html":{"href":"https://github.com/ampproject/amphtml/pull/1211"},"issue":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/1211"},"comments":{"href":"https://api.github.com/repos/ampproject/amphtml/issues/1211/comments"},"review_comments":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1211/comments"},"review_comment":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ampproject/amphtml/pulls/1211/commits"},"statuses":{"href":"https://api.github.com/repos/ampproject/amphtml/statuses/fda10821aa06f1468d7e3dda8aa8e527ccbc78dc"}}}}