{"action":"created","comment":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/92743555","pull_request_review_id":13264498,"id":92743555,"diff_hunk":"@@ -70,24 +70,22 @@ function downloadImage (item, callback, isCrossOrigin, img) {\n \n     var url = urlAppendTimestamp(item.url);\n     img = img || new Image();\n-    if (isCrossOrigin && window.location.origin !== 'file://') {\n+    if (isCrossOrigin && window.location.protocol !== 'file:') {\n         img.crossOrigin = 'anonymous';\n     }\n     else {\n         img.crossOrigin = null;\n     }\n \n-    if (img.complete && img.naturalWidth > 0) {\n+    if (img.complete && img.naturalWidth > 0 && img.src === url) {\n         callback(null, img);\n     }\n     else {\n         function loadCallback () {\n             img.removeEventListener('load', loadCallback);\n             img.removeEventListener('error', errorCallback);\n \n-            if (callback) {","path":"cocos2d/core/load-pipeline/downloader.js","position":21,"original_position":21,"commit_id":"e709e026c1221103abbcbd50c47c75814b557e0a","original_commit_id":"e709e026c1221103abbcbd50c47c75814b557e0a","user":{"login":"jareguo","id":1503156,"avatar_url":"https://avatars.githubusercontent.com/u/1503156?v=3","gravatar_id":"","url":"https://api.github.com/users/jareguo","html_url":"https://github.com/jareguo","followers_url":"https://api.github.com/users/jareguo/followers","following_url":"https://api.github.com/users/jareguo/following{/other_user}","gists_url":"https://api.github.com/users/jareguo/gists{/gist_id}","starred_url":"https://api.github.com/users/jareguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareguo/subscriptions","organizations_url":"https://api.github.com/users/jareguo/orgs","repos_url":"https://api.github.com/users/jareguo/repos","events_url":"https://api.github.com/users/jareguo/events{/privacy}","received_events_url":"https://api.github.com/users/jareguo/received_events","type":"User","site_admin":false},"body":"这个 if 判断是多余的，因为其它分支都没判断 callback","created_at":"2016-12-16T02:53:09Z","updated_at":"2016-12-16T02:53:09Z","html_url":"https://github.com/cocos-creator/engine/pull/1371#discussion_r92743555","pull_request_url":"https://api.github.com/repos/cocos-creator/engine/pulls/1371","_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments/92743555"},"html":{"href":"https://github.com/cocos-creator/engine/pull/1371#discussion_r92743555"},"pull_request":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/1371"}}},"pull_request":{"url":"https://api.github.com/repos/cocos-creator/engine/pulls/1371","id":98270467,"html_url":"https://github.com/cocos-creator/engine/pull/1371","diff_url":"https://github.com/cocos-creator/engine/pull/1371.diff","patch_url":"https://github.com/cocos-creator/engine/pull/1371.patch","issue_url":"https://api.github.com/repos/cocos-creator/engine/issues/1371","number":1371,"state":"open","locked":false,"title":"update downloadImage","user":{"login":"jareguo","id":1503156,"avatar_url":"https://avatars.githubusercontent.com/u/1503156?v=3","gravatar_id":"","url":"https://api.github.com/users/jareguo","html_url":"https://github.com/jareguo","followers_url":"https://api.github.com/users/jareguo/followers","following_url":"https://api.github.com/users/jareguo/following{/other_user}","gists_url":"https://api.github.com/users/jareguo/gists{/gist_id}","starred_url":"https://api.github.com/users/jareguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareguo/subscriptions","organizations_url":"https://api.github.com/users/jareguo/orgs","repos_url":"https://api.github.com/users/jareguo/repos","events_url":"https://api.github.com/users/jareguo/events{/privacy}","received_events_url":"https://api.github.com/users/jareguo/received_events","type":"User","site_admin":false},"body":"Changes proposed in this pull request:\r\n * 修了 downloadImage 一些潜在的 bug\r\n\r\n@pandamicro \r\n\r\n","created_at":"2016-12-16T02:51:04Z","updated_at":"2016-12-16T02:53:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4982af1b5a11ce7c0219b0b339931342cedde7c6","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cocos-creator/engine/pulls/1371/commits","review_comments_url":"https://api.github.com/repos/cocos-creator/engine/pulls/1371/comments","review_comment_url":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cocos-creator/engine/issues/1371/comments","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/e709e026c1221103abbcbd50c47c75814b557e0a","head":{"label":"jareguo:master","ref":"master","sha":"e709e026c1221103abbcbd50c47c75814b557e0a","user":{"login":"jareguo","id":1503156,"avatar_url":"https://avatars.githubusercontent.com/u/1503156?v=3","gravatar_id":"","url":"https://api.github.com/users/jareguo","html_url":"https://github.com/jareguo","followers_url":"https://api.github.com/users/jareguo/followers","following_url":"https://api.github.com/users/jareguo/following{/other_user}","gists_url":"https://api.github.com/users/jareguo/gists{/gist_id}","starred_url":"https://api.github.com/users/jareguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareguo/subscriptions","organizations_url":"https://api.github.com/users/jareguo/orgs","repos_url":"https://api.github.com/users/jareguo/repos","events_url":"https://api.github.com/users/jareguo/events{/privacy}","received_events_url":"https://api.github.com/users/jareguo/received_events","type":"User","site_admin":false},"repo":{"id":54607319,"name":"engine","full_name":"jareguo/engine","owner":{"login":"jareguo","id":1503156,"avatar_url":"https://avatars.githubusercontent.com/u/1503156?v=3","gravatar_id":"","url":"https://api.github.com/users/jareguo","html_url":"https://github.com/jareguo","followers_url":"https://api.github.com/users/jareguo/followers","following_url":"https://api.github.com/users/jareguo/following{/other_user}","gists_url":"https://api.github.com/users/jareguo/gists{/gist_id}","starred_url":"https://api.github.com/users/jareguo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jareguo/subscriptions","organizations_url":"https://api.github.com/users/jareguo/orgs","repos_url":"https://api.github.com/users/jareguo/repos","events_url":"https://api.github.com/users/jareguo/events{/privacy}","received_events_url":"https://api.github.com/users/jareguo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jareguo/engine","description":"New integrated engine to replace cocos2d-html5","fork":true,"url":"https://api.github.com/repos/jareguo/engine","forks_url":"https://api.github.com/repos/jareguo/engine/forks","keys_url":"https://api.github.com/repos/jareguo/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jareguo/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jareguo/engine/teams","hooks_url":"https://api.github.com/repos/jareguo/engine/hooks","issue_events_url":"https://api.github.com/repos/jareguo/engine/issues/events{/number}","events_url":"https://api.github.com/repos/jareguo/engine/events","assignees_url":"https://api.github.com/repos/jareguo/engine/assignees{/user}","branches_url":"https://api.github.com/repos/jareguo/engine/branches{/branch}","tags_url":"https://api.github.com/repos/jareguo/engine/tags","blobs_url":"https://api.github.com/repos/jareguo/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jareguo/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jareguo/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/jareguo/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jareguo/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/jareguo/engine/languages","stargazers_url":"https://api.github.com/repos/jareguo/engine/stargazers","contributors_url":"https://api.github.com/repos/jareguo/engine/contributors","subscribers_url":"https://api.github.com/repos/jareguo/engine/subscribers","subscription_url":"https://api.github.com/repos/jareguo/engine/subscription","commits_url":"https://api.github.com/repos/jareguo/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/jareguo/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/jareguo/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/jareguo/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/jareguo/engine/contents/{+path}","compare_url":"https://api.github.com/repos/jareguo/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jareguo/engine/merges","archive_url":"https://api.github.com/repos/jareguo/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jareguo/engine/downloads","issues_url":"https://api.github.com/repos/jareguo/engine/issues{/number}","pulls_url":"https://api.github.com/repos/jareguo/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/jareguo/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/jareguo/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jareguo/engine/labels{/name}","releases_url":"https://api.github.com/repos/jareguo/engine/releases{/id}","deployments_url":"https://api.github.com/repos/jareguo/engine/deployments","created_at":"2016-03-24T02:07:07Z","updated_at":"2016-10-24T07:30:12Z","pushed_at":"2016-12-16T02:52:32Z","git_url":"git://github.com/jareguo/engine.git","ssh_url":"git@github.com:jareguo/engine.git","clone_url":"https://github.com/jareguo/engine.git","svn_url":"https://github.com/jareguo/engine","homepage":null,"size":25830,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"cocos-creator:master","ref":"master","sha":"df360173d405a9456012564169d39ac52d279889","user":{"login":"cocos-creator","id":6937061,"avatar_url":"https://avatars.githubusercontent.com/u/6937061?v=3","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"repo":{"id":47440536,"name":"engine","full_name":"cocos-creator/engine","owner":{"login":"cocos-creator","id":6937061,"avatar_url":"https://avatars.githubusercontent.com/u/6937061?v=3","gravatar_id":"","url":"https://api.github.com/users/cocos-creator","html_url":"https://github.com/cocos-creator","followers_url":"https://api.github.com/users/cocos-creator/followers","following_url":"https://api.github.com/users/cocos-creator/following{/other_user}","gists_url":"https://api.github.com/users/cocos-creator/gists{/gist_id}","starred_url":"https://api.github.com/users/cocos-creator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cocos-creator/subscriptions","organizations_url":"https://api.github.com/users/cocos-creator/orgs","repos_url":"https://api.github.com/users/cocos-creator/repos","events_url":"https://api.github.com/users/cocos-creator/events{/privacy}","received_events_url":"https://api.github.com/users/cocos-creator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cocos-creator/engine","description":"The engine for Cocos Creator","fork":false,"url":"https://api.github.com/repos/cocos-creator/engine","forks_url":"https://api.github.com/repos/cocos-creator/engine/forks","keys_url":"https://api.github.com/repos/cocos-creator/engine/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cocos-creator/engine/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cocos-creator/engine/teams","hooks_url":"https://api.github.com/repos/cocos-creator/engine/hooks","issue_events_url":"https://api.github.com/repos/cocos-creator/engine/issues/events{/number}","events_url":"https://api.github.com/repos/cocos-creator/engine/events","assignees_url":"https://api.github.com/repos/cocos-creator/engine/assignees{/user}","branches_url":"https://api.github.com/repos/cocos-creator/engine/branches{/branch}","tags_url":"https://api.github.com/repos/cocos-creator/engine/tags","blobs_url":"https://api.github.com/repos/cocos-creator/engine/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cocos-creator/engine/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cocos-creator/engine/git/refs{/sha}","trees_url":"https://api.github.com/repos/cocos-creator/engine/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cocos-creator/engine/statuses/{sha}","languages_url":"https://api.github.com/repos/cocos-creator/engine/languages","stargazers_url":"https://api.github.com/repos/cocos-creator/engine/stargazers","contributors_url":"https://api.github.com/repos/cocos-creator/engine/contributors","subscribers_url":"https://api.github.com/repos/cocos-creator/engine/subscribers","subscription_url":"https://api.github.com/repos/cocos-creator/engine/subscription","commits_url":"https://api.github.com/repos/cocos-creator/engine/commits{/sha}","git_commits_url":"https://api.github.com/repos/cocos-creator/engine/git/commits{/sha}","comments_url":"https://api.github.com/repos/cocos-creator/engine/comments{/number}","issue_comment_url":"https://api.github.com/repos/cocos-creator/engine/issues/comments{/number}","contents_url":"https://api.github.com/repos/cocos-creator/engine/contents/{+path}","compare_url":"https://api.github.com/repos/cocos-creator/engine/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cocos-creator/engine/merges","archive_url":"https://api.github.com/repos/cocos-creator/engine/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cocos-creator/engine/downloads","issues_url":"https://api.github.com/repos/cocos-creator/engine/issues{/number}","pulls_url":"https://api.github.com/repos/cocos-creator/engine/pulls{/number}","milestones_url":"https://api.github.com/repos/cocos-creator/engine/milestones{/number}","notifications_url":"https://api.github.com/repos/cocos-creator/engine/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cocos-creator/engine/labels{/name}","releases_url":"https://api.github.com/repos/cocos-creator/engine/releases{/id}","deployments_url":"https://api.github.com/repos/cocos-creator/engine/deployments","created_at":"2015-12-05T03:28:59Z","updated_at":"2016-12-15T12:36:03Z","pushed_at":"2016-12-16T02:52:32Z","git_url":"git://github.com/cocos-creator/engine.git","ssh_url":"git@github.com:cocos-creator/engine.git","clone_url":"https://github.com/cocos-creator/engine.git","svn_url":"https://github.com/cocos-creator/engine","homepage":"http://www.cocos2d-x.org/creator","size":25820,"stargazers_count":156,"watchers_count":156,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":102,"mirror_url":null,"open_issues_count":24,"forks":102,"open_issues":24,"watchers":156,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/1371"},"html":{"href":"https://github.com/cocos-creator/engine/pull/1371"},"issue":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/1371"},"comments":{"href":"https://api.github.com/repos/cocos-creator/engine/issues/1371/comments"},"review_comments":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/1371/comments"},"review_comment":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cocos-creator/engine/pulls/1371/commits"},"statuses":{"href":"https://api.github.com/repos/cocos-creator/engine/statuses/e709e026c1221103abbcbd50c47c75814b557e0a"}}}}
{"actor":{"display_login":"jareguo"}}