{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/positron/pulls/comments/63914498","id":63914498,"diff_hunk":"@@ -0,0 +1,24 @@\n+/* This Source Code Form is subject to the terms of the Mozilla Public\n+ * License, v. 2.0. If a copy of the MPL was not distributed with this\n+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n+\n+\"use strict\";\n+\n+const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;\n+\n+// Described In Electron's id_weak_map.h as:\n+// \"Like ES6's WeakMap, but the key is Integer and the value is Weak Pointer.\"\n+\n+function IDWeakMap() {\n+  const map = new Map();\n+  this.set = function(key, value) {\n+    map.set(key, Cu.getWeakReference(value));\n+  };\n+  this.get = function(key) {\n+    return map.get(key).get();\n+  }\n+  this.has = map.has.bind(map);\n+  this.clear = map.clear.bind(map);\n+}","path":"positron/modules/atom_common_id_weak_map.js","position":22,"original_position":22,"commit_id":"cfbbfd37361b72383e3ffa36b8722db6a8f47b90","original_commit_id":"cc889d1f74d1e538d37f27ea8ef4c505a40f396c","user":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"body":"> Do you know if it matters that these properties are on the instance rather than the prototype? If we want them on the prototype, we might need something like this:\r\n\r\nI don't think it matters. In theory, the prototype-based implementation is more performant, but I don't know if it's actually more performant in practice. And I don't think this is performance-sensitive code (i.e. that the number of IDWeakMap instances is high enough for a difference in construction perf to matter). However, I'm happy switch to it anyway, if you prefer it for another reason.\r\n","created_at":"2016-05-19T16:50:59Z","updated_at":"2016-05-19T16:50:59Z","html_url":"https://github.com/mozilla/positron/pull/26#discussion_r63914498","pull_request_url":"https://api.github.com/repos/mozilla/positron/pulls/26","_links":{"self":{"href":"https://api.github.com/repos/mozilla/positron/pulls/comments/63914498"},"html":{"href":"https://github.com/mozilla/positron/pull/26#discussion_r63914498"},"pull_request":{"href":"https://api.github.com/repos/mozilla/positron/pulls/26"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/positron/pulls/26","id":67278507,"html_url":"https://github.com/mozilla/positron/pull/26","diff_url":"https://github.com/mozilla/positron/pull/26.diff","patch_url":"https://github.com/mozilla/positron/pull/26.patch","issue_url":"https://api.github.com/repos/mozilla/positron/issues/26","number":26,"state":"open","locked":false,"title":"run renderer process init.js script to initialize environment (fixes #25)","user":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"body":"This branch evaluates the renderer process init.js script when a module loader is constructed for a new BrowserWindow. Running that script entrains a bunch of dependencies, including many Node core modules and some Node core native bindings. But relatively few of the Node APIs are actually exercised, from what I can tell. So it should be possible to get the script working without having to rewrite much Node.\r\n\r\nSo far this branch imports a bunch of Node modules verbatim and stubs a few native bindings.\r\n","created_at":"2016-04-21T00:10:46Z","updated_at":"2016-05-19T16:50:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"471cec359bbd917129584a8f43545093fe26f4cd","assignee":{"login":"marcoscaceres","id":870154,"avatar_url":"https://avatars.githubusercontent.com/u/870154?v=3","gravatar_id":"","url":"https://api.github.com/users/marcoscaceres","html_url":"https://github.com/marcoscaceres","followers_url":"https://api.github.com/users/marcoscaceres/followers","following_url":"https://api.github.com/users/marcoscaceres/following{/other_user}","gists_url":"https://api.github.com/users/marcoscaceres/gists{/gist_id}","starred_url":"https://api.github.com/users/marcoscaceres/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcoscaceres/subscriptions","organizations_url":"https://api.github.com/users/marcoscaceres/orgs","repos_url":"https://api.github.com/users/marcoscaceres/repos","events_url":"https://api.github.com/users/marcoscaceres/events{/privacy}","received_events_url":"https://api.github.com/users/marcoscaceres/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/positron/pulls/26/commits","review_comments_url":"https://api.github.com/repos/mozilla/positron/pulls/26/comments","review_comment_url":"https://api.github.com/repos/mozilla/positron/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/positron/issues/26/comments","statuses_url":"https://api.github.com/repos/mozilla/positron/statuses/cfbbfd37361b72383e3ffa36b8722db6a8f47b90","head":{"label":"mykmelez:renderer-init-js","ref":"renderer-init-js","sha":"cfbbfd37361b72383e3ffa36b8722db6a8f47b90","user":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"repo":{"id":55822600,"name":"positron","full_name":"mykmelez/positron","owner":{"login":"mykmelez","id":305455,"avatar_url":"https://avatars.githubusercontent.com/u/305455?v=3","gravatar_id":"","url":"https://api.github.com/users/mykmelez","html_url":"https://github.com/mykmelez","followers_url":"https://api.github.com/users/mykmelez/followers","following_url":"https://api.github.com/users/mykmelez/following{/other_user}","gists_url":"https://api.github.com/users/mykmelez/gists{/gist_id}","starred_url":"https://api.github.com/users/mykmelez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mykmelez/subscriptions","organizations_url":"https://api.github.com/users/mykmelez/orgs","repos_url":"https://api.github.com/users/mykmelez/repos","events_url":"https://api.github.com/users/mykmelez/events{/privacy}","received_events_url":"https://api.github.com/users/mykmelez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mykmelez/positron","description":" Electron-compatible runtime on top of Gecko","fork":true,"url":"https://api.github.com/repos/mykmelez/positron","forks_url":"https://api.github.com/repos/mykmelez/positron/forks","keys_url":"https://api.github.com/repos/mykmelez/positron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mykmelez/positron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mykmelez/positron/teams","hooks_url":"https://api.github.com/repos/mykmelez/positron/hooks","issue_events_url":"https://api.github.com/repos/mykmelez/positron/issues/events{/number}","events_url":"https://api.github.com/repos/mykmelez/positron/events","assignees_url":"https://api.github.com/repos/mykmelez/positron/assignees{/user}","branches_url":"https://api.github.com/repos/mykmelez/positron/branches{/branch}","tags_url":"https://api.github.com/repos/mykmelez/positron/tags","blobs_url":"https://api.github.com/repos/mykmelez/positron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mykmelez/positron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mykmelez/positron/git/refs{/sha}","trees_url":"https://api.github.com/repos/mykmelez/positron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mykmelez/positron/statuses/{sha}","languages_url":"https://api.github.com/repos/mykmelez/positron/languages","stargazers_url":"https://api.github.com/repos/mykmelez/positron/stargazers","contributors_url":"https://api.github.com/repos/mykmelez/positron/contributors","subscribers_url":"https://api.github.com/repos/mykmelez/positron/subscribers","subscription_url":"https://api.github.com/repos/mykmelez/positron/subscription","commits_url":"https://api.github.com/repos/mykmelez/positron/commits{/sha}","git_commits_url":"https://api.github.com/repos/mykmelez/positron/git/commits{/sha}","comments_url":"https://api.github.com/repos/mykmelez/positron/comments{/number}","issue_comment_url":"https://api.github.com/repos/mykmelez/positron/issues/comments{/number}","contents_url":"https://api.github.com/repos/mykmelez/positron/contents/{+path}","compare_url":"https://api.github.com/repos/mykmelez/positron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mykmelez/positron/merges","archive_url":"https://api.github.com/repos/mykmelez/positron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mykmelez/positron/downloads","issues_url":"https://api.github.com/repos/mykmelez/positron/issues{/number}","pulls_url":"https://api.github.com/repos/mykmelez/positron/pulls{/number}","milestones_url":"https://api.github.com/repos/mykmelez/positron/milestones{/number}","notifications_url":"https://api.github.com/repos/mykmelez/positron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mykmelez/positron/labels{/name}","releases_url":"https://api.github.com/repos/mykmelez/positron/releases{/id}","deployments_url":"https://api.github.com/repos/mykmelez/positron/deployments","created_at":"2016-04-09T02:47:10Z","updated_at":"2016-04-13T21:15:14Z","pushed_at":"2016-05-19T16:40:43Z","git_url":"git://github.com/mykmelez/positron.git","ssh_url":"git@github.com:mykmelez/positron.git","clone_url":"https://github.com/mykmelez/positron.git","svn_url":"https://github.com/mykmelez/positron","homepage":"","size":2251403,"stargazers_count":1,"watchers_count":1,"language":null,"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":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"dd73f7c5e0ce0a70649470bd4db1ab25c4ff19c9","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":55816251,"name":"positron","full_name":"mozilla/positron","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/positron","description":"Electron-compatible runtime on top of Gecko","fork":false,"url":"https://api.github.com/repos/mozilla/positron","forks_url":"https://api.github.com/repos/mozilla/positron/forks","keys_url":"https://api.github.com/repos/mozilla/positron/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/positron/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/positron/teams","hooks_url":"https://api.github.com/repos/mozilla/positron/hooks","issue_events_url":"https://api.github.com/repos/mozilla/positron/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/positron/events","assignees_url":"https://api.github.com/repos/mozilla/positron/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/positron/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/positron/tags","blobs_url":"https://api.github.com/repos/mozilla/positron/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/positron/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/positron/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/positron/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/positron/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/positron/languages","stargazers_url":"https://api.github.com/repos/mozilla/positron/stargazers","contributors_url":"https://api.github.com/repos/mozilla/positron/contributors","subscribers_url":"https://api.github.com/repos/mozilla/positron/subscribers","subscription_url":"https://api.github.com/repos/mozilla/positron/subscription","commits_url":"https://api.github.com/repos/mozilla/positron/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/positron/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/positron/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/positron/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/positron/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/positron/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/positron/merges","archive_url":"https://api.github.com/repos/mozilla/positron/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/positron/downloads","issues_url":"https://api.github.com/repos/mozilla/positron/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/positron/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/positron/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/positron/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/positron/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/positron/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/positron/deployments","created_at":"2016-04-08T23:45:34Z","updated_at":"2016-05-19T14:31:17Z","pushed_at":"2016-05-19T16:40:44Z","git_url":"git://github.com/mozilla/positron.git","ssh_url":"git@github.com:mozilla/positron.git","clone_url":"https://github.com/mozilla/positron.git","svn_url":"https://github.com/mozilla/positron","homepage":"","size":2251434,"stargazers_count":187,"watchers_count":187,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"open_issues_count":14,"forks":10,"open_issues":14,"watchers":187,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/positron/pulls/26"},"html":{"href":"https://github.com/mozilla/positron/pull/26"},"issue":{"href":"https://api.github.com/repos/mozilla/positron/issues/26"},"comments":{"href":"https://api.github.com/repos/mozilla/positron/issues/26/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/positron/pulls/26/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/positron/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/positron/pulls/26/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/positron/statuses/cfbbfd37361b72383e3ffa36b8722db6a8f47b90"}}}}