GitHub PullRequestReviewCommentEvent at 2014-08-12 15:22:31
Repository: angular.js
Actor: IgorMinar
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/angular/angular.js/pulls/comments/16119769","id":16119769,"diff_hunk":"@@ -1472,25 +1476,29 @@ function bindJQuery() {\n       inheritedData: JQLitePrototype.inheritedData\n     });\n \n-    originalCleanData = jQuery.cleanData;\n-    // Prevent double-proxying.\n-    originalCleanData = originalCleanData.$$original || originalCleanData;\n-\n     // All nodes removed from the DOM via various jQuery APIs like .remove()\n     // are passed through jQuery.cleanData. Monkey-patch this method to fire\n     // the $destroy event on all removed nodes.\n-    jQuery.cleanData = function(elems) {\n-      for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n-        jQuery(elem).triggerHandler('$destroy');\n-      }\n-      originalCleanData(elems);\n-    };\n-    jQuery.cleanData.$$original = originalCleanData;\n+    jQuery.cleanData = (function (originalCleanData) {\n+      return function(elems) {\n+        if (!angular.$$skipDestroy) {\n+          for (var i = 0, elem; (elem = elems[i]) != null; i++) {\n+            jQuery(elem).triggerHandler('$destroy');\n+          }\n+        } else {\n+          angular.$$skipDestroy = false;\n+        }\n+        originalCleanData(elems);\n+      };\n+    })(jQuery.cleanData);","path":"src/Angular.js","position":43,"original_position":43,"commit_id":"ff0d5a76a1f887dc8f7321ba2cfbbda7982ca263","original_commit_id":"ff0d5a76a1f887dc8f7321ba2cfbbda7982ca263","user":{"login":"IgorMinar","id":216296,"avatar_url":"https://avatars.githubusercontent.com/u/216296?v=2","gravatar_id":"fc5dc0d579fb554752763792a2d5f449","url":"https://api.github.com/users/IgorMinar","html_url":"https://github.com/IgorMinar","followers_url":"https://api.github.com/users/IgorMinar/followers","following_url":"https://api.github.com/users/IgorMinar/following{/other_user}","gists_url":"https://api.github.com/users/IgorMinar/gists{/gist_id}","starred_url":"https://api.github.com/users/IgorMinar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/IgorMinar/subscriptions","organizations_url":"https://api.github.com/users/IgorMinar/orgs","repos_url":"https://api.github.com/users/IgorMinar/repos","events_url":"https://api.github.com/users/IgorMinar/events{/privacy}","received_events_url":"https://api.github.com/users/IgorMinar/received_events","type":"User","site_admin":false},"body":"is this IFFE buying you anything? you can just capture the fn before overwriting it with `var originalCleanData = jQuery.cleanData;`, am I missing something?","created_at":"2014-08-12T15:22:31Z","updated_at":"2014-08-12T15:22:31Z","html_url":"https://github.com/angular/angular.js/pull/8486#discussion_r16119769","pull_request_url":"https://api.github.com/repos/angular/angular.js/pulls/8486","_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/comments/16119769"},"html":{"href":"https://github.com/angular/angular.js/pull/8486#discussion_r16119769"},"pull_request":{"href":"https://api.github.com/repos/angular/angular.js/pulls/8486"}}},"pull_request":{"url":"https://api.github.com/repos/angular/angular.js/pulls/8486","id":19339256,"html_url":"https://github.com/angular/angular.js/pull/8486","diff_url":"https://github.com/angular/angular.js/pull/8486.diff","patch_url":"https://github.com/angular/angular.js/pull/8486.patch","issue_url":"https://api.github.com/repos/angular/angular.js/issues/8486","number":8486,"state":"open","title":"fix(jQuery): cooperate with other libraries monkey-patching jQuery.cleanData","user":{"login":"mzgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=2","gravatar_id":"72ea0622f7b690ed82f5261b16ff8cef","url":"https://api.github.com/users/mzgol","html_url":"https://github.com/mzgol","followers_url":"https://api.github.com/users/mzgol/followers","following_url":"https://api.github.com/users/mzgol/following{/other_user}","gists_url":"https://api.github.com/users/mzgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mzgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzgol/subscriptions","organizations_url":"https://api.github.com/users/mzgol/orgs","repos_url":"https://api.github.com/users/mzgol/repos","events_url":"https://api.github.com/users/mzgol/events{/privacy}","received_events_url":"https://api.github.com/users/mzgol/received_events","type":"User","site_admin":false},"body":"Some libraries (like jQuery UI) patch jQuery.cleanData as well. This commit\r\nmakes Angular work correctly even if such external patching was done after\r\nthe Angular one.\r\n\r\nFixes #8471\r\n\r\n/cc @IgorMinar","created_at":"2014-08-05T12:43:42Z","updated_at":"2014-08-12T15:22:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"81d5c0e34bedbb0c5d1da0d2937d7a36ec1d6a68","assignee":{"login":"mzgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=2","gravatar_id":"72ea0622f7b690ed82f5261b16ff8cef","url":"https://api.github.com/users/mzgol","html_url":"https://github.com/mzgol","followers_url":"https://api.github.com/users/mzgol/followers","following_url":"https://api.github.com/users/mzgol/following{/other_user}","gists_url":"https://api.github.com/users/mzgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mzgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzgol/subscriptions","organizations_url":"https://api.github.com/users/mzgol/orgs","repos_url":"https://api.github.com/users/mzgol/repos","events_url":"https://api.github.com/users/mzgol/events{/privacy}","received_events_url":"https://api.github.com/users/mzgol/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/angular/angular.js/milestones/61","labels_url":"https://api.github.com/repos/angular/angular.js/milestones/61/labels","id":732391,"number":61,"title":"1.3.0-beta.18","description":"","creator":{"login":"jeffbcross","id":463703,"avatar_url":"https://avatars.githubusercontent.com/u/463703?v=2","gravatar_id":"007ba2fad36ea1313710744713dd6594","url":"https://api.github.com/users/jeffbcross","html_url":"https://github.com/jeffbcross","followers_url":"https://api.github.com/users/jeffbcross/followers","following_url":"https://api.github.com/users/jeffbcross/following{/other_user}","gists_url":"https://api.github.com/users/jeffbcross/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffbcross/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffbcross/subscriptions","organizations_url":"https://api.github.com/users/jeffbcross/orgs","repos_url":"https://api.github.com/users/jeffbcross/repos","events_url":"https://api.github.com/users/jeffbcross/events{/privacy}","received_events_url":"https://api.github.com/users/jeffbcross/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":28,"state":"open","created_at":"2014-07-25T18:06:30Z","updated_at":"2014-08-12T06:15:10Z","due_on":"2014-08-09T07:00:00Z"},"commits_url":"https://api.github.com/repos/angular/angular.js/pulls/8486/commits","review_comments_url":"https://api.github.com/repos/angular/angular.js/pulls/8486/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/8486/comments","statuses_url":"https://api.github.com/repos/angular/angular.js/statuses/ff0d5a76a1f887dc8f7321ba2cfbbda7982ca263","head":{"label":"mzgol:cleanData","ref":"cleanData","sha":"ff0d5a76a1f887dc8f7321ba2cfbbda7982ca263","user":{"login":"mzgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=2","gravatar_id":"72ea0622f7b690ed82f5261b16ff8cef","url":"https://api.github.com/users/mzgol","html_url":"https://github.com/mzgol","followers_url":"https://api.github.com/users/mzgol/followers","following_url":"https://api.github.com/users/mzgol/following{/other_user}","gists_url":"https://api.github.com/users/mzgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mzgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzgol/subscriptions","organizations_url":"https://api.github.com/users/mzgol/orgs","repos_url":"https://api.github.com/users/mzgol/repos","events_url":"https://api.github.com/users/mzgol/events{/privacy}","received_events_url":"https://api.github.com/users/mzgol/received_events","type":"User","site_admin":false},"repo":{"id":9753166,"name":"angular.js","full_name":"mzgol/angular.js","owner":{"login":"mzgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=2","gravatar_id":"72ea0622f7b690ed82f5261b16ff8cef","url":"https://api.github.com/users/mzgol","html_url":"https://github.com/mzgol","followers_url":"https://api.github.com/users/mzgol/followers","following_url":"https://api.github.com/users/mzgol/following{/other_user}","gists_url":"https://api.github.com/users/mzgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mzgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzgol/subscriptions","organizations_url":"https://api.github.com/users/mzgol/orgs","repos_url":"https://api.github.com/users/mzgol/repos","events_url":"https://api.github.com/users/mzgol/events{/privacy}","received_events_url":"https://api.github.com/users/mzgol/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mzgol/angular.js","description":"","fork":true,"url":"https://api.github.com/repos/mzgol/angular.js","forks_url":"https://api.github.com/repos/mzgol/angular.js/forks","keys_url":"https://api.github.com/repos/mzgol/angular.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mzgol/angular.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mzgol/angular.js/teams","hooks_url":"https://api.github.com/repos/mzgol/angular.js/hooks","issue_events_url":"https://api.github.com/repos/mzgol/angular.js/issues/events{/number}","events_url":"https://api.github.com/repos/mzgol/angular.js/events","assignees_url":"https://api.github.com/repos/mzgol/angular.js/assignees{/user}","branches_url":"https://api.github.com/repos/mzgol/angular.js/branches{/branch}","tags_url":"https://api.github.com/repos/mzgol/angular.js/tags","blobs_url":"https://api.github.com/repos/mzgol/angular.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mzgol/angular.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mzgol/angular.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/mzgol/angular.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mzgol/angular.js/statuses/{sha}","languages_url":"https://api.github.com/repos/mzgol/angular.js/languages","stargazers_url":"https://api.github.com/repos/mzgol/angular.js/stargazers","contributors_url":"https://api.github.com/repos/mzgol/angular.js/contributors","subscribers_url":"https://api.github.com/repos/mzgol/angular.js/subscribers","subscription_url":"https://api.github.com/repos/mzgol/angular.js/subscription","commits_url":"https://api.github.com/repos/mzgol/angular.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/mzgol/angular.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/mzgol/angular.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/mzgol/angular.js/issues/comments/{number}","contents_url":"https://api.github.com/repos/mzgol/angular.js/contents/{+path}","compare_url":"https://api.github.com/repos/mzgol/angular.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mzgol/angular.js/merges","archive_url":"https://api.github.com/repos/mzgol/angular.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mzgol/angular.js/downloads","issues_url":"https://api.github.com/repos/mzgol/angular.js/issues{/number}","pulls_url":"https://api.github.com/repos/mzgol/angular.js/pulls{/number}","milestones_url":"https://api.github.com/repos/mzgol/angular.js/milestones{/number}","notifications_url":"https://api.github.com/repos/mzgol/angular.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mzgol/angular.js/labels{/name}","releases_url":"https://api.github.com/repos/mzgol/angular.js/releases{/id}","created_at":"2013-04-29T16:57:39Z","updated_at":"2014-06-24T15:15:28Z","pushed_at":"2014-08-05T12:54:10Z","git_url":"git://github.com/mzgol/angular.js.git","ssh_url":"git@github.com:mzgol/angular.js.git","clone_url":"https://github.com/mzgol/angular.js.git","svn_url":"https://github.com/mzgol/angular.js","homepage":"http://angularjs.org","size":54034,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"60c13a17a776e79c4b8ebf2d15dc0a4aef15d9a9","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=2","gravatar_id":"f0d91e5cf8ad1ce7972cc486baa20c42","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=2","gravatar_id":"f0d91e5cf8ad1ce7972cc486baa20c42","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":"2014-08-12T14:57:30Z","pushed_at":"2014-08-11T19:30:14Z","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":205847,"stargazers_count":27146,"watchers_count":27146,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"forks_count":9855,"mirror_url":null,"open_issues_count":1124,"forks":9855,"open_issues":1124,"watchers":27146,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/angular.js/pulls/8486"},"html":{"href":"https://github.com/angular/angular.js/pull/8486"},"issue":{"href":"https://api.github.com/repos/angular/angular.js/issues/8486"},"comments":{"href":"https://api.github.com/repos/angular/angular.js/issues/8486/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/angular.js/pulls/8486/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/8486/commits"},"statuses":{"href":"https://api.github.com/repos/angular/angular.js/statuses/ff0d5a76a1f887dc8f7321ba2cfbbda7982ca263"}}}}