{"action":"created","comment":{"url":"https://api.github.com/repos/atom/loophole/pulls/comments/37038699","id":37038699,"diff_hunk":"@@ -2,19 +2,35 @@ vm = require 'vm'\n \n exports.allowUnsafeEval = (fn) ->\n   previousEval = global.eval\n+  callback = -> global.eval = previousEval\n+  error = false\n   try\n     global.eval = (source) -> vm.runInThisContext(source)\n-    fn()\n+    fn(callback)","path":"src/loophole.coffee","position":9,"original_position":9,"commit_id":"5b315f37b3f21826a7a2e6af14496aa6f91c12b5","original_commit_id":"5b315f37b3f21826a7a2e6af14496aa6f91c12b5","user":{"login":"stevemao","id":6316590,"avatar_url":"https://avatars.githubusercontent.com/u/6316590?v=3","gravatar_id":"","url":"https://api.github.com/users/stevemao","html_url":"https://github.com/stevemao","followers_url":"https://api.github.com/users/stevemao/followers","following_url":"https://api.github.com/users/stevemao/following{/other_user}","gists_url":"https://api.github.com/users/stevemao/gists{/gist_id}","starred_url":"https://api.github.com/users/stevemao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevemao/subscriptions","organizations_url":"https://api.github.com/users/stevemao/orgs","repos_url":"https://api.github.com/users/stevemao/repos","events_url":"https://api.github.com/users/stevemao/events{/privacy}","received_events_url":"https://api.github.com/users/stevemao/received_events","type":"User","site_admin":false},"body":"Basically I put both `sync` and `async` in the same `try..catch` block. but an extra var `error = false` is unfortunate. not sure if we could simplify this.","created_at":"2015-08-13T23:52:15Z","updated_at":"2015-08-13T23:52:15Z","html_url":"https://github.com/atom/loophole/pull/7#discussion_r37038699","pull_request_url":"https://api.github.com/repos/atom/loophole/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/atom/loophole/pulls/comments/37038699"},"html":{"href":"https://github.com/atom/loophole/pull/7#discussion_r37038699"},"pull_request":{"href":"https://api.github.com/repos/atom/loophole/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/atom/loophole/pulls/7","id":42304840,"html_url":"https://github.com/atom/loophole/pull/7","diff_url":"https://github.com/atom/loophole/pull/7.diff","patch_url":"https://github.com/atom/loophole/pull/7.patch","issue_url":"https://api.github.com/repos/atom/loophole/issues/7","number":7,"state":"open","locked":false,"title":"Support optional callback for async flows","user":{"login":"stevemao","id":6316590,"avatar_url":"https://avatars.githubusercontent.com/u/6316590?v=3","gravatar_id":"","url":"https://api.github.com/users/stevemao","html_url":"https://github.com/stevemao","followers_url":"https://api.github.com/users/stevemao/followers","following_url":"https://api.github.com/users/stevemao/following{/other_user}","gists_url":"https://api.github.com/users/stevemao/gists{/gist_id}","starred_url":"https://api.github.com/users/stevemao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevemao/subscriptions","organizations_url":"https://api.github.com/users/stevemao/orgs","repos_url":"https://api.github.com/users/stevemao/repos","events_url":"https://api.github.com/users/stevemao/events{/privacy}","received_events_url":"https://api.github.com/users/stevemao/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-13T00:36:29Z","updated_at":"2015-08-13T23:52:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"2551ad018dadfbbd0a4dd09ab854351bef39caf9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/atom/loophole/pulls/7/commits","review_comments_url":"https://api.github.com/repos/atom/loophole/pulls/7/comments","review_comment_url":"https://api.github.com/repos/atom/loophole/pulls/comments{/number}","comments_url":"https://api.github.com/repos/atom/loophole/issues/7/comments","statuses_url":"https://api.github.com/repos/atom/loophole/statuses/5b315f37b3f21826a7a2e6af14496aa6f91c12b5","head":{"label":"stevemao:async","ref":"async","sha":"5b315f37b3f21826a7a2e6af14496aa6f91c12b5","user":{"login":"stevemao","id":6316590,"avatar_url":"https://avatars.githubusercontent.com/u/6316590?v=3","gravatar_id":"","url":"https://api.github.com/users/stevemao","html_url":"https://github.com/stevemao","followers_url":"https://api.github.com/users/stevemao/followers","following_url":"https://api.github.com/users/stevemao/following{/other_user}","gists_url":"https://api.github.com/users/stevemao/gists{/gist_id}","starred_url":"https://api.github.com/users/stevemao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevemao/subscriptions","organizations_url":"https://api.github.com/users/stevemao/orgs","repos_url":"https://api.github.com/users/stevemao/repos","events_url":"https://api.github.com/users/stevemao/events{/privacy}","received_events_url":"https://api.github.com/users/stevemao/received_events","type":"User","site_admin":false},"repo":{"id":40578279,"name":"loophole","full_name":"stevemao/loophole","owner":{"login":"stevemao","id":6316590,"avatar_url":"https://avatars.githubusercontent.com/u/6316590?v=3","gravatar_id":"","url":"https://api.github.com/users/stevemao","html_url":"https://github.com/stevemao","followers_url":"https://api.github.com/users/stevemao/followers","following_url":"https://api.github.com/users/stevemao/following{/other_user}","gists_url":"https://api.github.com/users/stevemao/gists{/gist_id}","starred_url":"https://api.github.com/users/stevemao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevemao/subscriptions","organizations_url":"https://api.github.com/users/stevemao/orgs","repos_url":"https://api.github.com/users/stevemao/repos","events_url":"https://api.github.com/users/stevemao/events{/privacy}","received_events_url":"https://api.github.com/users/stevemao/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/stevemao/loophole","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom with CSP enabled","fork":true,"url":"https://api.github.com/repos/stevemao/loophole","forks_url":"https://api.github.com/repos/stevemao/loophole/forks","keys_url":"https://api.github.com/repos/stevemao/loophole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/stevemao/loophole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/stevemao/loophole/teams","hooks_url":"https://api.github.com/repos/stevemao/loophole/hooks","issue_events_url":"https://api.github.com/repos/stevemao/loophole/issues/events{/number}","events_url":"https://api.github.com/repos/stevemao/loophole/events","assignees_url":"https://api.github.com/repos/stevemao/loophole/assignees{/user}","branches_url":"https://api.github.com/repos/stevemao/loophole/branches{/branch}","tags_url":"https://api.github.com/repos/stevemao/loophole/tags","blobs_url":"https://api.github.com/repos/stevemao/loophole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/stevemao/loophole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/stevemao/loophole/git/refs{/sha}","trees_url":"https://api.github.com/repos/stevemao/loophole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/stevemao/loophole/statuses/{sha}","languages_url":"https://api.github.com/repos/stevemao/loophole/languages","stargazers_url":"https://api.github.com/repos/stevemao/loophole/stargazers","contributors_url":"https://api.github.com/repos/stevemao/loophole/contributors","subscribers_url":"https://api.github.com/repos/stevemao/loophole/subscribers","subscription_url":"https://api.github.com/repos/stevemao/loophole/subscription","commits_url":"https://api.github.com/repos/stevemao/loophole/commits{/sha}","git_commits_url":"https://api.github.com/repos/stevemao/loophole/git/commits{/sha}","comments_url":"https://api.github.com/repos/stevemao/loophole/comments{/number}","issue_comment_url":"https://api.github.com/repos/stevemao/loophole/issues/comments{/number}","contents_url":"https://api.github.com/repos/stevemao/loophole/contents/{+path}","compare_url":"https://api.github.com/repos/stevemao/loophole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/stevemao/loophole/merges","archive_url":"https://api.github.com/repos/stevemao/loophole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/stevemao/loophole/downloads","issues_url":"https://api.github.com/repos/stevemao/loophole/issues{/number}","pulls_url":"https://api.github.com/repos/stevemao/loophole/pulls{/number}","milestones_url":"https://api.github.com/repos/stevemao/loophole/milestones{/number}","notifications_url":"https://api.github.com/repos/stevemao/loophole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/stevemao/loophole/labels{/name}","releases_url":"https://api.github.com/repos/stevemao/loophole/releases{/id}","created_at":"2015-08-12T03:26:45Z","updated_at":"2015-08-12T03:26:46Z","pushed_at":"2015-08-13T00:37:04Z","git_url":"git://github.com/stevemao/loophole.git","ssh_url":"git@github.com:stevemao/loophole.git","clone_url":"https://github.com/stevemao/loophole.git","svn_url":"https://github.com/stevemao/loophole","homepage":null,"size":1922,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","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":"atom:master","ref":"master","sha":"6afebe160a233420dbca591bd5081b12c47cdb15","user":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"repo":{"id":17531107,"name":"loophole","full_name":"atom/loophole","owner":{"login":"atom","id":1089146,"avatar_url":"https://avatars.githubusercontent.com/u/1089146?v=3","gravatar_id":"","url":"https://api.github.com/users/atom","html_url":"https://github.com/atom","followers_url":"https://api.github.com/users/atom/followers","following_url":"https://api.github.com/users/atom/following{/other_user}","gists_url":"https://api.github.com/users/atom/gists{/gist_id}","starred_url":"https://api.github.com/users/atom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/atom/subscriptions","organizations_url":"https://api.github.com/users/atom/orgs","repos_url":"https://api.github.com/users/atom/repos","events_url":"https://api.github.com/users/atom/events{/privacy}","received_events_url":"https://api.github.com/users/atom/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/atom/loophole","description":"A hack to enable use of libraries that depend on a basic form of eval in Atom with CSP enabled","fork":false,"url":"https://api.github.com/repos/atom/loophole","forks_url":"https://api.github.com/repos/atom/loophole/forks","keys_url":"https://api.github.com/repos/atom/loophole/keys{/key_id}","collaborators_url":"https://api.github.com/repos/atom/loophole/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/atom/loophole/teams","hooks_url":"https://api.github.com/repos/atom/loophole/hooks","issue_events_url":"https://api.github.com/repos/atom/loophole/issues/events{/number}","events_url":"https://api.github.com/repos/atom/loophole/events","assignees_url":"https://api.github.com/repos/atom/loophole/assignees{/user}","branches_url":"https://api.github.com/repos/atom/loophole/branches{/branch}","tags_url":"https://api.github.com/repos/atom/loophole/tags","blobs_url":"https://api.github.com/repos/atom/loophole/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/atom/loophole/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/atom/loophole/git/refs{/sha}","trees_url":"https://api.github.com/repos/atom/loophole/git/trees{/sha}","statuses_url":"https://api.github.com/repos/atom/loophole/statuses/{sha}","languages_url":"https://api.github.com/repos/atom/loophole/languages","stargazers_url":"https://api.github.com/repos/atom/loophole/stargazers","contributors_url":"https://api.github.com/repos/atom/loophole/contributors","subscribers_url":"https://api.github.com/repos/atom/loophole/subscribers","subscription_url":"https://api.github.com/repos/atom/loophole/subscription","commits_url":"https://api.github.com/repos/atom/loophole/commits{/sha}","git_commits_url":"https://api.github.com/repos/atom/loophole/git/commits{/sha}","comments_url":"https://api.github.com/repos/atom/loophole/comments{/number}","issue_comment_url":"https://api.github.com/repos/atom/loophole/issues/comments{/number}","contents_url":"https://api.github.com/repos/atom/loophole/contents/{+path}","compare_url":"https://api.github.com/repos/atom/loophole/compare/{base}...{head}","merges_url":"https://api.github.com/repos/atom/loophole/merges","archive_url":"https://api.github.com/repos/atom/loophole/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/atom/loophole/downloads","issues_url":"https://api.github.com/repos/atom/loophole/issues{/number}","pulls_url":"https://api.github.com/repos/atom/loophole/pulls{/number}","milestones_url":"https://api.github.com/repos/atom/loophole/milestones{/number}","notifications_url":"https://api.github.com/repos/atom/loophole/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/atom/loophole/labels{/name}","releases_url":"https://api.github.com/repos/atom/loophole/releases{/id}","created_at":"2014-03-07T23:58:53Z","updated_at":"2015-08-07T15:39:20Z","pushed_at":"2015-08-13T00:37:06Z","git_url":"git://github.com/atom/loophole.git","ssh_url":"git@github.com:atom/loophole.git","clone_url":"https://github.com/atom/loophole.git","svn_url":"https://github.com/atom/loophole","homepage":null,"size":210,"stargazers_count":21,"watchers_count":21,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":21,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/atom/loophole/pulls/7"},"html":{"href":"https://github.com/atom/loophole/pull/7"},"issue":{"href":"https://api.github.com/repos/atom/loophole/issues/7"},"comments":{"href":"https://api.github.com/repos/atom/loophole/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/atom/loophole/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/atom/loophole/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/atom/loophole/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/atom/loophole/statuses/5b315f37b3f21826a7a2e6af14496aa6f91c12b5"}}}}