{"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.js/pulls/comments/49116968","id":49116968,"diff_hunk":"@@ -134,8 +134,13 @@ angular.module('ngSanitize').filter('linky', ['$sanitize', function($sanitize) {\n         /((ftp|https?):\\/\\/|(www\\.)|(mailto:)?[A-Za-z0-9._%+-]+@)\\S*[^\\s.;,(){}<>\"\\u201d\\u2019]/i,\n       MAILTO_REGEXP = /^mailto:/i;\n \n+  var linkyMinErr = angular.$$minErr('linky');\n+  var isString = angular.isString;\n+\n   return function(text, target, attributes) {\n-    if (!text) return text;\n+    if (text == null) return text;\n+    if (!isString(text)) throw linkyMinErr('notstring', 'Expected string but received: {0}', text);\n+\n     var match;","path":"src/ngSanitize/filter/linky.js","position":12,"original_position":12,"commit_id":"7ee3586d113dd67798a73281c2f0ecfa6b7297ee","original_commit_id":"7ee3586d113dd67798a73281c2f0ecfa6b7297ee","user":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"body":"We might as well. It is in a separate module and so it doesn't impact on the size of the core angular.js file. It saves a few microseconds per digest if the string is empty as we don't need to run the regex or the sanitizer.","created_at":"2016-01-07T19:48:03Z","updated_at":"2016-01-07T19:48:03Z","html_url":"https://github.com/angular/angular.js/pull/13693#discussion_r49116968","pull_request_url":"https://api.github.com/repos/angular/angular.js/pulls/13693","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/49116968"},"html":{"href":"https://github.com/angular/angular.js/pull/13693#discussion_r49116968"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.js/pulls/13693"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/13693","id":55225237,"html_url":"https://github.com/angular/angular.js/pull/13693","diff_url":"https://github.com/angular/angular.js/pull/13693.diff","patch_url":"https://github.com/angular/angular.js/pull/13693.patch","issue_url":"https://api.github.com/repos/angular/angular.js/issues/13693","number":13693,"state":"open","locked":false,"title":"fix(linky): throw error if input is not a string","user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"body":"BREAKING CHANGE:\r\n\r\nBefore this change, the filter assumed that the input (if not undefined/null) was of type 'string'\r\nand that certain methods (such as `.match()`) would be available on it. Passing a non-string value\r\nwould most likely result in a not-very-useful error being thrown (trying to call a method that does\r\nnot exist) or in unexpected behavior (if the input happened to have the assumed methods).\r\n\r\nAfter this change, a proper (informative) error will be thrown. If you want to pass non-string\r\nvalues through `linky`, you need to explicitly convert them to strings first.\r\nSince input values could be initialized asynchronously, `undefined` or `null` will still be\r\nreturned unchanged (without throwing an error).\r\n\r\nCloses #13547","created_at":"2016-01-06T15:32:27Z","updated_at":"2016-01-07T19:48:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c8f482ca358a6f132b937e131b1c2c60d6b292a9","assignee":null,"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/105","html_url":"https://github.com/angular/angular.js/milestones/1.6.x","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/105/labels","id":1317216,"number":105,"title":"1.6.x","description":null,"creator":{"login":"petebacondarwin","id":15655,"avatar_url":"https://avatars.githubusercontent.com/u/15655?v=3","gravatar_id":"","url":"https://api.github.com/users/petebacondarwin","html_url":"https://github.com/petebacondarwin","followers_url":"https://api.github.com/users/petebacondarwin/followers","following_url":"https://api.github.com/users/petebacondarwin/following{/other_user}","gists_url":"https://api.github.com/users/petebacondarwin/gists{/gist_id}","starred_url":"https://api.github.com/users/petebacondarwin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/petebacondarwin/subscriptions","organizations_url":"https://api.github.com/users/petebacondarwin/orgs","repos_url":"https://api.github.com/users/petebacondarwin/repos","events_url":"https://api.github.com/users/petebacondarwin/events{/privacy}","received_events_url":"https://api.github.com/users/petebacondarwin/received_events","type":"User","site_admin":false},"open_issues":36,"closed_issues":5,"state":"open","created_at":"2015-09-21T20:16:38Z","updated_at":"2016-01-07T14:14:11Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/angular/angular.js/pulls/13693/commits","review_comments_url":"https://api.github.com/repos/angular/angular.js/pulls/13693/comments","review_comment_url":"https://api.github.com/repos/angular/angular.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/angular.js/issues/13693/comments","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/7ee3586d113dd67798a73281c2f0ecfa6b7297ee","head":{"label":"gkalpak:fix-linky-throw-on-non-string-values","ref":"fix-linky-throw-on-non-string-values","sha":"7ee3586d113dd67798a73281c2f0ecfa6b7297ee","user":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"repo":{"id":23513120,"name":"angular.js","full_name":"gkalpak/angular.js","owner":{"login":"gkalpak","id":8604205,"avatar_url":"https://avatars.githubusercontent.com/u/8604205?v=3","gravatar_id":"","url":"https://api.github.com/users/gkalpak","html_url":"https://github.com/gkalpak","followers_url":"https://api.github.com/users/gkalpak/followers","following_url":"https://api.github.com/users/gkalpak/following{/other_user}","gists_url":"https://api.github.com/users/gkalpak/gists{/gist_id}","starred_url":"https://api.github.com/users/gkalpak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkalpak/subscriptions","organizations_url":"https://api.github.com/users/gkalpak/orgs","repos_url":"https://api.github.com/users/gkalpak/repos","events_url":"https://api.github.com/users/gkalpak/events{/privacy}","received_events_url":"https://api.github.com/users/gkalpak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gkalpak/angular.js","description":"HTML enhanced for web apps","fork":true,"url":"https://api.github.com/repos/gkalpak/angular.js","forks_url":"https://api.github.com/repos/gkalpak/angular.js/forks","keys_url":"https://api.github.com/repos/gkalpak/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gkalpak/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gkalpak/angular.js/teams","hooks_url":"https://api.github.com/repos/gkalpak/angular.js/hooks","issue_events_url":"https://api.github.com/repos/gkalpak/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/gkalpak/angular.js/events","assignees_url":"https://api.github.com/repos/gkalpak/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/gkalpak/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/gkalpak/angular.js/tags","blobs_url":"https://api.github.com/repos/gkalpak/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gkalpak/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gkalpak/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/gkalpak/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gkalpak/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/gkalpak/angular.js/languages","stargazers_url":"https://api.github.com/repos/gkalpak/angular.js/stargazers","contributors_url":"https://api.github.com/repos/gkalpak/angular.js/contributors","subscribers_url":"https://api.github.com/repos/gkalpak/angular.js/subscribers","subscription_url":"https://api.github.com/repos/gkalpak/angular.js/subscription","commits_url":"https://api.github.com/repos/gkalpak/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/gkalpak/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/gkalpak/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/gkalpak/angular.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/gkalpak/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/gkalpak/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gkalpak/angular.js/merges","archive_url":"https://api.github.com/repos/gkalpak/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gkalpak/angular.js/downloads","issues_url":"https://api.github.com/repos/gkalpak/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/gkalpak/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/gkalpak/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/gkalpak/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gkalpak/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/gkalpak/angular.js/releases{/id}","created_at":"2014-08-31T12:31:10Z","updated_at":"2015-05-04T19:48:04Z","pushed_at":"2016-01-07T16:12:05Z","git_url":"git://github.com/gkalpak/angular.js.git","ssh_url":"git@github.com:gkalpak/angular.js.git","clone_url":"https://github.com/gkalpak/angular.js.git","svn_url":"https://github.com/gkalpak/angular.js","homepage":"http://angularjs.org","size":70400,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":2,"forks":0,"open_issues":2,"watchers":1,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"e1def1b8fe543fde09abda076d66606027f7dbeb","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":460078,"name":"angular.js","full_name":"angular/angular.js","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/angular.js","description":"HTML enhanced for web apps","fork":false,"url":"https://api.github.com/repos/angular/angular.js","forks_url":"https://api.github.com/repos/angular/angular.js/forks","keys_url":"https://api.github.com/repos/angular/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/angular.js/teams","hooks_url":"https://api.github.com/repos/angular/angular.js/hooks","issue_events_url":"https://api.github.com/repos/angular/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/angular/angular.js/events","assignees_url":"https://api.github.com/repos/angular/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/angular/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/angular/angular.js/tags","blobs_url":"https://api.github.com/repos/angular/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/angular.js/languages","stargazers_url":"https://api.github.com/repos/angular/angular.js/stargazers","contributors_url":"https://api.github.com/repos/angular/angular.js/contributors","subscribers_url":"https://api.github.com/repos/angular/angular.js/subscribers","subscription_url":"https://api.github.com/repos/angular/angular.js/subscription","commits_url":"https://api.github.com/repos/angular/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/angular.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/angular/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/angular.js/merges","archive_url":"https://api.github.com/repos/angular/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/angular.js/downloads","issues_url":"https://api.github.com/repos/angular/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/angular/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/angular/angular.js/releases{/id}","created_at":"2010-01-06T00:34:37Z","updated_at":"2016-01-07T19:24:27Z","pushed_at":"2016-01-07T19:43:54Z","git_url":"git://github.com/angular/angular.js.git","ssh_url":"git@github.com:angular/angular.js.git","clone_url":"https://github.com/angular/angular.js.git","svn_url":"https://github.com/angular/angular.js","homepage":"http://angularjs.org","size":140899,"stargazers_count":45814,"watchers_count":45814,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":21186,"mirror_url":null,"open_issues_count":1291,"forks":21186,"open_issues":1291,"watchers":45814,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/13693"},"html":{"href":"https://github.com/angular/angular.js/pull/13693"},"issue":{"href":"https://api.github.com/repos/angular/angular.js/issues/13693"},"comments":{"href":"https://api.github.com/repos/angular/angular.js/issues/13693/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.js/pulls/13693/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/angular.js/pulls/13693/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.js/statuses/7ee3586d113dd67798a73281c2f0ecfa6b7297ee"}}}}