{"action":"created","comment":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/comments/82648091","pull_request_review_id":3541348,"id":82648091,"diff_hunk":"@@ -1759,39 +1772,39 @@ mergeInto(LibraryManager.library, {\n     // You can also call this with a typed array instead of a url. It will then\n     // do preloading for the Image/Audio part, as if the typed array were the\n     // result of an XHR that you did manually.\n-    createPreloadedFile: function(parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish) {\n+    createPreloadedFile: function(parent, name, url, canRead, canWrite, onload, onerror, dontCreateFile, canOwn, preFinish, noRunDep) {\n       Browser.init(); // XXX perhaps this method should move onto Browser?\n       // TODO we should allow people to just pass in a complete filename instead\n       // of parent and name being that we just join them anyways\n       var fullname = name ? PATH.resolve(PATH.join2(parent, name)) : parent;\n-      var dep = getUniqueRunDependency('cp ' + fullname); // might have several active requests for the same fullname\n+      var dep = !noRunDep ? getUniqueRunDependency('cp ' + fullname) : ''; // might have several active requests for the same fullname\n       function processData(byteArray) {\n         function finish(byteArray) {\n           if (preFinish) preFinish();\n           if (!dontCreateFile) {\n             FS.createDataFile(parent, name, byteArray, canRead, canWrite, canOwn);\n           }\n           if (onload) onload();\n-          removeRunDependency(dep);\n+          if (!noRunDep) removeRunDependency(dep);","path":"src/library_fs.js","position":40,"original_position":40,"commit_id":"9ab6cf6dcada9536a237a1eada0ad0212e2f50d1","original_commit_id":"9ab6cf6dcada9536a237a1eada0ad0212e2f50d1","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"body":"these checks would be nicer to read, I think if they were `if (dep) ..` (which is functionally identical here).","created_at":"2016-10-10T17:30:24Z","updated_at":"2016-10-10T17:30:24Z","html_url":"https://github.com/kripken/emscripten/pull/4617#discussion_r82648091","pull_request_url":"https://api.github.com/repos/kripken/emscripten/pulls/4617","_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments/82648091"},"html":{"href":"https://github.com/kripken/emscripten/pull/4617#discussion_r82648091"},"pull_request":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/4617"}}},"pull_request":{"url":"https://api.github.com/repos/kripken/emscripten/pulls/4617","id":88656935,"html_url":"https://github.com/kripken/emscripten/pull/4617","diff_url":"https://github.com/kripken/emscripten/pull/4617.diff","patch_url":"https://github.com/kripken/emscripten/pull/4617.patch","issue_url":"https://api.github.com/repos/kripken/emscripten/issues/4617","number":4617,"state":"open","locked":false,"title":"Emscripten wget fixes","user":{"login":"juj","id":225351,"avatar_url":"https://avatars.githubusercontent.com/u/225351?v=3","gravatar_id":"","url":"https://api.github.com/users/juj","html_url":"https://github.com/juj","followers_url":"https://api.github.com/users/juj/followers","following_url":"https://api.github.com/users/juj/following{/other_user}","gists_url":"https://api.github.com/users/juj/gists{/gist_id}","starred_url":"https://api.github.com/users/juj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juj/subscriptions","organizations_url":"https://api.github.com/users/juj/orgs","repos_url":"https://api.github.com/users/juj/repos","events_url":"https://api.github.com/users/juj/events{/privacy}","received_events_url":"https://api.github.com/users/juj/received_events","type":"User","site_admin":false},"body":"Some fixes:\r\n\r\n1. `emscripten_wget()` and `emscripten_async_wget()` always called `add/removeRunDependency()`, which is a bit silly since these are C APIs, so they are called after application runtime has already been initialized, so it's too late for the run dependencies. \r\n2. Attempting to simultaneously wget the same URL twice would throw an exception, because of the above got called with identical dependency IDs.\r\n3. wgetting to a destination directory on the filesystem that does not exist would lead to an exception \"file not found\". This changes the semantics to create the destination directory tree instead.\r\n\r\nRegarding 1), I'm not quite sure if it would be a good use case to have static data initializers be able to call emscripten_wget() to preload stuff before main() has been called? If that it something that would make sense, then perhaps the fix for 2) will need to be something different.","created_at":"2016-10-10T12:50:50Z","updated_at":"2016-10-10T17:30:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6a78218ea8e0820451f3d213265e84690803fe56","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/kripken/emscripten/pulls/4617/commits","review_comments_url":"https://api.github.com/repos/kripken/emscripten/pulls/4617/comments","review_comment_url":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kripken/emscripten/issues/4617/comments","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/9ab6cf6dcada9536a237a1eada0ad0212e2f50d1","head":{"label":"juj:emscripten_wget_fixes","ref":"emscripten_wget_fixes","sha":"9ab6cf6dcada9536a237a1eada0ad0212e2f50d1","user":{"login":"juj","id":225351,"avatar_url":"https://avatars.githubusercontent.com/u/225351?v=3","gravatar_id":"","url":"https://api.github.com/users/juj","html_url":"https://github.com/juj","followers_url":"https://api.github.com/users/juj/followers","following_url":"https://api.github.com/users/juj/following{/other_user}","gists_url":"https://api.github.com/users/juj/gists{/gist_id}","starred_url":"https://api.github.com/users/juj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juj/subscriptions","organizations_url":"https://api.github.com/users/juj/orgs","repos_url":"https://api.github.com/users/juj/repos","events_url":"https://api.github.com/users/juj/events{/privacy}","received_events_url":"https://api.github.com/users/juj/received_events","type":"User","site_admin":false},"repo":{"id":4149606,"name":"emscripten","full_name":"juj/emscripten","owner":{"login":"juj","id":225351,"avatar_url":"https://avatars.githubusercontent.com/u/225351?v=3","gravatar_id":"","url":"https://api.github.com/users/juj","html_url":"https://github.com/juj","followers_url":"https://api.github.com/users/juj/followers","following_url":"https://api.github.com/users/juj/following{/other_user}","gists_url":"https://api.github.com/users/juj/gists{/gist_id}","starred_url":"https://api.github.com/users/juj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juj/subscriptions","organizations_url":"https://api.github.com/users/juj/orgs","repos_url":"https://api.github.com/users/juj/repos","events_url":"https://api.github.com/users/juj/events{/privacy}","received_events_url":"https://api.github.com/users/juj/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/juj/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":true,"url":"https://api.github.com/repos/juj/emscripten","forks_url":"https://api.github.com/repos/juj/emscripten/forks","keys_url":"https://api.github.com/repos/juj/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/juj/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/juj/emscripten/teams","hooks_url":"https://api.github.com/repos/juj/emscripten/hooks","issue_events_url":"https://api.github.com/repos/juj/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/juj/emscripten/events","assignees_url":"https://api.github.com/repos/juj/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/juj/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/juj/emscripten/tags","blobs_url":"https://api.github.com/repos/juj/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/juj/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/juj/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/juj/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/juj/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/juj/emscripten/languages","stargazers_url":"https://api.github.com/repos/juj/emscripten/stargazers","contributors_url":"https://api.github.com/repos/juj/emscripten/contributors","subscribers_url":"https://api.github.com/repos/juj/emscripten/subscribers","subscription_url":"https://api.github.com/repos/juj/emscripten/subscription","commits_url":"https://api.github.com/repos/juj/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/juj/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/juj/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/juj/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/juj/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/juj/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/juj/emscripten/merges","archive_url":"https://api.github.com/repos/juj/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/juj/emscripten/downloads","issues_url":"https://api.github.com/repos/juj/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/juj/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/juj/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/juj/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/juj/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/juj/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/juj/emscripten/deployments","created_at":"2012-04-26T16:19:07Z","updated_at":"2015-10-14T22:05:06Z","pushed_at":"2016-10-10T12:42:58Z","git_url":"git://github.com/juj/emscripten.git","ssh_url":"git@github.com:juj/emscripten.git","clone_url":"https://github.com/juj/emscripten.git","svn_url":"https://github.com/juj/emscripten","homepage":"","size":133736,"stargazers_count":3,"watchers_count":3,"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":3,"default_branch":"master"}},"base":{"label":"kripken:incoming","ref":"incoming","sha":"46fb089b1c53a91a096439e47be3b03f04a313b0","user":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"repo":{"id":1357796,"name":"emscripten","full_name":"kripken/emscripten","owner":{"login":"kripken","id":173661,"avatar_url":"https://avatars.githubusercontent.com/u/173661?v=3","gravatar_id":"","url":"https://api.github.com/users/kripken","html_url":"https://github.com/kripken","followers_url":"https://api.github.com/users/kripken/followers","following_url":"https://api.github.com/users/kripken/following{/other_user}","gists_url":"https://api.github.com/users/kripken/gists{/gist_id}","starred_url":"https://api.github.com/users/kripken/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kripken/subscriptions","organizations_url":"https://api.github.com/users/kripken/orgs","repos_url":"https://api.github.com/users/kripken/repos","events_url":"https://api.github.com/users/kripken/events{/privacy}","received_events_url":"https://api.github.com/users/kripken/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/kripken/emscripten","description":"Emscripten: An LLVM-to-JavaScript Compiler","fork":false,"url":"https://api.github.com/repos/kripken/emscripten","forks_url":"https://api.github.com/repos/kripken/emscripten/forks","keys_url":"https://api.github.com/repos/kripken/emscripten/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kripken/emscripten/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kripken/emscripten/teams","hooks_url":"https://api.github.com/repos/kripken/emscripten/hooks","issue_events_url":"https://api.github.com/repos/kripken/emscripten/issues/events{/number}","events_url":"https://api.github.com/repos/kripken/emscripten/events","assignees_url":"https://api.github.com/repos/kripken/emscripten/assignees{/user}","branches_url":"https://api.github.com/repos/kripken/emscripten/branches{/branch}","tags_url":"https://api.github.com/repos/kripken/emscripten/tags","blobs_url":"https://api.github.com/repos/kripken/emscripten/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kripken/emscripten/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kripken/emscripten/git/refs{/sha}","trees_url":"https://api.github.com/repos/kripken/emscripten/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kripken/emscripten/statuses/{sha}","languages_url":"https://api.github.com/repos/kripken/emscripten/languages","stargazers_url":"https://api.github.com/repos/kripken/emscripten/stargazers","contributors_url":"https://api.github.com/repos/kripken/emscripten/contributors","subscribers_url":"https://api.github.com/repos/kripken/emscripten/subscribers","subscription_url":"https://api.github.com/repos/kripken/emscripten/subscription","commits_url":"https://api.github.com/repos/kripken/emscripten/commits{/sha}","git_commits_url":"https://api.github.com/repos/kripken/emscripten/git/commits{/sha}","comments_url":"https://api.github.com/repos/kripken/emscripten/comments{/number}","issue_comment_url":"https://api.github.com/repos/kripken/emscripten/issues/comments{/number}","contents_url":"https://api.github.com/repos/kripken/emscripten/contents/{+path}","compare_url":"https://api.github.com/repos/kripken/emscripten/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kripken/emscripten/merges","archive_url":"https://api.github.com/repos/kripken/emscripten/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kripken/emscripten/downloads","issues_url":"https://api.github.com/repos/kripken/emscripten/issues{/number}","pulls_url":"https://api.github.com/repos/kripken/emscripten/pulls{/number}","milestones_url":"https://api.github.com/repos/kripken/emscripten/milestones{/number}","notifications_url":"https://api.github.com/repos/kripken/emscripten/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kripken/emscripten/labels{/name}","releases_url":"https://api.github.com/repos/kripken/emscripten/releases{/id}","deployments_url":"https://api.github.com/repos/kripken/emscripten/deployments","created_at":"2011-02-12T05:23:30Z","updated_at":"2016-10-10T14:38:34Z","pushed_at":"2016-10-10T12:50:50Z","git_url":"git://github.com/kripken/emscripten.git","ssh_url":"git@github.com:kripken/emscripten.git","clone_url":"https://github.com/kripken/emscripten.git","svn_url":"https://github.com/kripken/emscripten","homepage":"","size":173033,"stargazers_count":10748,"watchers_count":10748,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1341,"mirror_url":null,"open_issues_count":870,"forks":1341,"open_issues":870,"watchers":10748,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/4617"},"html":{"href":"https://github.com/kripken/emscripten/pull/4617"},"issue":{"href":"https://api.github.com/repos/kripken/emscripten/issues/4617"},"comments":{"href":"https://api.github.com/repos/kripken/emscripten/issues/4617/comments"},"review_comments":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/4617/comments"},"review_comment":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kripken/emscripten/pulls/4617/commits"},"statuses":{"href":"https://api.github.com/repos/kripken/emscripten/statuses/9ab6cf6dcada9536a237a1eada0ad0212e2f50d1"}}}}
{"actor":{"display_login":"kripken"}}