{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/179962351","pull_request_review_id":110300743,"id":179962351,"diff_hunk":"@@ -98,6 +102,47 @@ class ContextifyContext {\n       const v8::PropertyCallbackInfo<v8::Boolean>& args);\n };\n \n+class ContextifyScript : public BaseObject {\n+ private:\n+  Persistent<v8::UnboundScript> script_;\n+\n+  static void New(const v8::FunctionCallbackInfo<v8::Value>& args);\n+  static bool InstanceOf(Environment* env, const v8::Local<v8::Value>& value);\n+  static void RunInThisContext(const v8::FunctionCallbackInfo<v8::Value>& args);\n+  static void RunInContext(const v8::FunctionCallbackInfo<v8::Value>& args);\n+  static void DecorateErrorStack(\n+      Environment* env,\n+      const v8::TryCatch& try_catch);\n+  static bool EvalMachine(\n+      Environment* env,\n+      const int64_t timeout,\n+      const bool display_errors,\n+      const bool break_on_sigint,\n+      const v8::FunctionCallbackInfo<v8::Value>& args);\n+\n+\n+  static int Identity_;\n+\n+ public:\n+  static void Init(Environment* env, v8::Local<v8::Object> target);\n+  static ContextifyScript* GetFromID(v8::Local<v8::Context>, int id);\n+  int id;\n+\n+  ContextifyScript(Environment* env, v8::Local<v8::Object> object)\n+    : BaseObject(env, object) {\n+      MakeWeak<ContextifyScript>(this);\n+      id = ContextifyScript::Identity_++;\n+  }\n+\n+  ~ContextifyScript() {\n+    // important to use GetCurrentContext so that we get the right dataset\n+    auto data = GetModuleData(env()->isolate()->GetCurrentContext());\n+    data->id_to_script_wrap_map.erase(id);\n+  }\n+\n+  Persistent<v8::Function> import_module_dynamically;","path":"src/node_contextify.h","position":53,"original_position":53,"commit_id":"83436ce02748686f0e5850d19552334922c7ba64","original_commit_id":"83436ce02748686f0e5850d19552334922c7ba64","user":{"login":"TimothyGu","id":1538624,"avatar_url":"https://avatars2.githubusercontent.com/u/1538624?v=4","gravatar_id":"","url":"https://api.github.com/users/TimothyGu","html_url":"https://github.com/TimothyGu","followers_url":"https://api.github.com/users/TimothyGu/followers","following_url":"https://api.github.com/users/TimothyGu/following{/other_user}","gists_url":"https://api.github.com/users/TimothyGu/gists{/gist_id}","starred_url":"https://api.github.com/users/TimothyGu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimothyGu/subscriptions","organizations_url":"https://api.github.com/users/TimothyGu/orgs","repos_url":"https://api.github.com/users/TimothyGu/repos","events_url":"https://api.github.com/users/TimothyGu/events{/privacy}","received_events_url":"https://api.github.com/users/TimothyGu/received_events","type":"User","site_admin":false},"body":"Never use public member variables. Add a getter returning a `Local<v8::Function>` instead if necessary. Also applies to `ModuleWrap`.","created_at":"2018-04-08T21:42:24Z","updated_at":"2018-04-08T21:46:02Z","html_url":"https://github.com/nodejs/node/pull/19717#discussion_r179962351","pull_request_url":"https://api.github.com/repos/nodejs/node/pulls/19717","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments/179962351"},"html":{"href":"https://github.com/nodejs/node/pull/19717#discussion_r179962351"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/19717"}}},"pull_request":{"url":"https://api.github.com/repos/nodejs/node/pulls/19717","id":178708475,"html_url":"https://github.com/nodejs/node/pull/19717","diff_url":"https://github.com/nodejs/node/pull/19717.diff","patch_url":"https://github.com/nodejs/node/pull/19717.patch","issue_url":"https://api.github.com/repos/nodejs/node/issues/19717","number":19717,"state":"open","locked":false,"title":"vm: add dynamic import callback and streamline initialize import.meta callback to match it","user":{"login":"devsnek","id":5952481,"avatar_url":"https://avatars3.githubusercontent.com/u/5952481?v=4","gravatar_id":"","url":"https://api.github.com/users/devsnek","html_url":"https://github.com/devsnek","followers_url":"https://api.github.com/users/devsnek/followers","following_url":"https://api.github.com/users/devsnek/following{/other_user}","gists_url":"https://api.github.com/users/devsnek/gists{/gist_id}","starred_url":"https://api.github.com/users/devsnek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devsnek/subscriptions","organizations_url":"https://api.github.com/users/devsnek/orgs","repos_url":"https://api.github.com/users/devsnek/repos","events_url":"https://api.github.com/users/devsnek/events{/privacy}","received_events_url":"https://api.github.com/users/devsnek/received_events","type":"User","site_admin":false},"body":"Fixes #19570\r\nFixes #19363\r\n\r\nCommits:\r\n\r\n- `src: flatten ContextifyScript`\r\n- `src, vm: implement scoped import.meta and dynamic import`\r\n- `repl: enable dynamic import`\r\n\r\n\r\nThis might be a little rough around the edges particularly with the c++ changes, i wasn't quite sure about the difference between the two map types except for that one had the methods i wanted 😓 \r\n\r\n##### Checklist\r\n\r\n- [x] `make -j4 test` (UNIX), or `vcbuild test` (Windows) passes\r\n- [x] tests and/or benchmarks are included\r\n- [x] documentation is changed or added\r\n- [x] commit message follows [commit guidelines](https://github.com/nodejs/node/blob/master/doc/guides/contributing/pull-requests.md#commit-message-guidelines)\r\n","created_at":"2018-04-01T01:43:08Z","updated_at":"2018-04-08T21:46:02Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fc773c146e76c25d3c353ae122dd17423c160c9","assignee":null,"assignees":[],"requested_reviewers":[{"login":"jkrems","id":567540,"avatar_url":"https://avatars1.githubusercontent.com/u/567540?v=4","gravatar_id":"","url":"https://api.github.com/users/jkrems","html_url":"https://github.com/jkrems","followers_url":"https://api.github.com/users/jkrems/followers","following_url":"https://api.github.com/users/jkrems/following{/other_user}","gists_url":"https://api.github.com/users/jkrems/gists{/gist_id}","starred_url":"https://api.github.com/users/jkrems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkrems/subscriptions","organizations_url":"https://api.github.com/users/jkrems/orgs","repos_url":"https://api.github.com/users/jkrems/repos","events_url":"https://api.github.com/users/jkrems/events{/privacy}","received_events_url":"https://api.github.com/users/jkrems/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":690799345,"url":"https://api.github.com/repos/nodejs/node/labels/ES%20Modules","name":"ES Modules","color":"0052cc","default":false},{"id":362054330,"url":"https://api.github.com/repos/nodejs/node/labels/blocked","name":"blocked","color":"b60205","default":false},{"id":155436007,"url":"https://api.github.com/repos/nodejs/node/labels/vm","name":"vm","color":"bfdadc","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/nodejs/node/pulls/19717/commits","review_comments_url":"https://api.github.com/repos/nodejs/node/pulls/19717/comments","review_comment_url":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nodejs/node/issues/19717/comments","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/83436ce02748686f0e5850d19552334922c7ba64","head":{"label":"devsnek:refactor/module-callbacks","ref":"refactor/module-callbacks","sha":"83436ce02748686f0e5850d19552334922c7ba64","user":{"login":"devsnek","id":5952481,"avatar_url":"https://avatars3.githubusercontent.com/u/5952481?v=4","gravatar_id":"","url":"https://api.github.com/users/devsnek","html_url":"https://github.com/devsnek","followers_url":"https://api.github.com/users/devsnek/followers","following_url":"https://api.github.com/users/devsnek/following{/other_user}","gists_url":"https://api.github.com/users/devsnek/gists{/gist_id}","starred_url":"https://api.github.com/users/devsnek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devsnek/subscriptions","organizations_url":"https://api.github.com/users/devsnek/orgs","repos_url":"https://api.github.com/users/devsnek/repos","events_url":"https://api.github.com/users/devsnek/events{/privacy}","received_events_url":"https://api.github.com/users/devsnek/received_events","type":"User","site_admin":false},"repo":{"id":86208251,"name":"node","full_name":"devsnek/node","owner":{"login":"devsnek","id":5952481,"avatar_url":"https://avatars3.githubusercontent.com/u/5952481?v=4","gravatar_id":"","url":"https://api.github.com/users/devsnek","html_url":"https://github.com/devsnek","followers_url":"https://api.github.com/users/devsnek/followers","following_url":"https://api.github.com/users/devsnek/following{/other_user}","gists_url":"https://api.github.com/users/devsnek/gists{/gist_id}","starred_url":"https://api.github.com/users/devsnek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devsnek/subscriptions","organizations_url":"https://api.github.com/users/devsnek/orgs","repos_url":"https://api.github.com/users/devsnek/repos","events_url":"https://api.github.com/users/devsnek/events{/privacy}","received_events_url":"https://api.github.com/users/devsnek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devsnek/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":true,"url":"https://api.github.com/repos/devsnek/node","forks_url":"https://api.github.com/repos/devsnek/node/forks","keys_url":"https://api.github.com/repos/devsnek/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devsnek/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devsnek/node/teams","hooks_url":"https://api.github.com/repos/devsnek/node/hooks","issue_events_url":"https://api.github.com/repos/devsnek/node/issues/events{/number}","events_url":"https://api.github.com/repos/devsnek/node/events","assignees_url":"https://api.github.com/repos/devsnek/node/assignees{/user}","branches_url":"https://api.github.com/repos/devsnek/node/branches{/branch}","tags_url":"https://api.github.com/repos/devsnek/node/tags","blobs_url":"https://api.github.com/repos/devsnek/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devsnek/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devsnek/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/devsnek/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devsnek/node/statuses/{sha}","languages_url":"https://api.github.com/repos/devsnek/node/languages","stargazers_url":"https://api.github.com/repos/devsnek/node/stargazers","contributors_url":"https://api.github.com/repos/devsnek/node/contributors","subscribers_url":"https://api.github.com/repos/devsnek/node/subscribers","subscription_url":"https://api.github.com/repos/devsnek/node/subscription","commits_url":"https://api.github.com/repos/devsnek/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/devsnek/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/devsnek/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/devsnek/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/devsnek/node/contents/{+path}","compare_url":"https://api.github.com/repos/devsnek/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devsnek/node/merges","archive_url":"https://api.github.com/repos/devsnek/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devsnek/node/downloads","issues_url":"https://api.github.com/repos/devsnek/node/issues{/number}","pulls_url":"https://api.github.com/repos/devsnek/node/pulls{/number}","milestones_url":"https://api.github.com/repos/devsnek/node/milestones{/number}","notifications_url":"https://api.github.com/repos/devsnek/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devsnek/node/labels{/name}","releases_url":"https://api.github.com/repos/devsnek/node/releases{/id}","deployments_url":"https://api.github.com/repos/devsnek/node/deployments","created_at":"2017-03-26T04:48:23Z","updated_at":"2018-04-05T16:55:38Z","pushed_at":"2018-04-07T15:09:13Z","git_url":"git://github.com/devsnek/node.git","ssh_url":"git@github.com:devsnek/node.git","clone_url":"https://github.com/devsnek/node.git","svn_url":"https://github.com/devsnek/node","homepage":"https://nodejs.org","size":318868,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nodejs:master","ref":"master","sha":"77b52fd58f7398a81999c81afd21fe2e156c0766","user":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"repo":{"id":27193779,"name":"node","full_name":"nodejs/node","owner":{"login":"nodejs","id":9950313,"avatar_url":"https://avatars3.githubusercontent.com/u/9950313?v=4","gravatar_id":"","url":"https://api.github.com/users/nodejs","html_url":"https://github.com/nodejs","followers_url":"https://api.github.com/users/nodejs/followers","following_url":"https://api.github.com/users/nodejs/following{/other_user}","gists_url":"https://api.github.com/users/nodejs/gists{/gist_id}","starred_url":"https://api.github.com/users/nodejs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nodejs/subscriptions","organizations_url":"https://api.github.com/users/nodejs/orgs","repos_url":"https://api.github.com/users/nodejs/repos","events_url":"https://api.github.com/users/nodejs/events{/privacy}","received_events_url":"https://api.github.com/users/nodejs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/nodejs/node","description":"Node.js JavaScript runtime :sparkles::turtle::rocket::sparkles:","fork":false,"url":"https://api.github.com/repos/nodejs/node","forks_url":"https://api.github.com/repos/nodejs/node/forks","keys_url":"https://api.github.com/repos/nodejs/node/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nodejs/node/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nodejs/node/teams","hooks_url":"https://api.github.com/repos/nodejs/node/hooks","issue_events_url":"https://api.github.com/repos/nodejs/node/issues/events{/number}","events_url":"https://api.github.com/repos/nodejs/node/events","assignees_url":"https://api.github.com/repos/nodejs/node/assignees{/user}","branches_url":"https://api.github.com/repos/nodejs/node/branches{/branch}","tags_url":"https://api.github.com/repos/nodejs/node/tags","blobs_url":"https://api.github.com/repos/nodejs/node/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nodejs/node/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nodejs/node/git/refs{/sha}","trees_url":"https://api.github.com/repos/nodejs/node/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nodejs/node/statuses/{sha}","languages_url":"https://api.github.com/repos/nodejs/node/languages","stargazers_url":"https://api.github.com/repos/nodejs/node/stargazers","contributors_url":"https://api.github.com/repos/nodejs/node/contributors","subscribers_url":"https://api.github.com/repos/nodejs/node/subscribers","subscription_url":"https://api.github.com/repos/nodejs/node/subscription","commits_url":"https://api.github.com/repos/nodejs/node/commits{/sha}","git_commits_url":"https://api.github.com/repos/nodejs/node/git/commits{/sha}","comments_url":"https://api.github.com/repos/nodejs/node/comments{/number}","issue_comment_url":"https://api.github.com/repos/nodejs/node/issues/comments{/number}","contents_url":"https://api.github.com/repos/nodejs/node/contents/{+path}","compare_url":"https://api.github.com/repos/nodejs/node/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nodejs/node/merges","archive_url":"https://api.github.com/repos/nodejs/node/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nodejs/node/downloads","issues_url":"https://api.github.com/repos/nodejs/node/issues{/number}","pulls_url":"https://api.github.com/repos/nodejs/node/pulls{/number}","milestones_url":"https://api.github.com/repos/nodejs/node/milestones{/number}","notifications_url":"https://api.github.com/repos/nodejs/node/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nodejs/node/labels{/name}","releases_url":"https://api.github.com/repos/nodejs/node/releases{/id}","deployments_url":"https://api.github.com/repos/nodejs/node/deployments","created_at":"2014-11-26T19:57:11Z","updated_at":"2018-04-08T21:28:19Z","pushed_at":"2018-04-08T19:40:45Z","git_url":"git://github.com/nodejs/node.git","ssh_url":"git@github.com:nodejs/node.git","clone_url":"https://github.com/nodejs/node.git","svn_url":"https://github.com/nodejs/node","homepage":"https://nodejs.org","size":362725,"stargazers_count":47341,"watchers_count":47341,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9941,"mirror_url":null,"archived":false,"open_issues_count":844,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":9941,"open_issues":844,"watchers":47341,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nodejs/node/pulls/19717"},"html":{"href":"https://github.com/nodejs/node/pull/19717"},"issue":{"href":"https://api.github.com/repos/nodejs/node/issues/19717"},"comments":{"href":"https://api.github.com/repos/nodejs/node/issues/19717/comments"},"review_comments":{"href":"https://api.github.com/repos/nodejs/node/pulls/19717/comments"},"review_comment":{"href":"https://api.github.com/repos/nodejs/node/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nodejs/node/pulls/19717/commits"},"statuses":{"href":"https://api.github.com/repos/nodejs/node/statuses/83436ce02748686f0e5850d19552334922c7ba64"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"TimothyGu"}}