{"action":"created","comment":{"url":"https://api.github.com/repos/nodejs/node/pulls/comments/179778325","pull_request_review_id":110089034,"id":179778325,"diff_hunk":"@@ -61,10 +33,20 @@ exports.setup = function() {\n   })();\n   loaderResolve(loaderPromise);\n \n-  setImportModuleDynamicallyCallback(async (referrer, specifier) => {\n-    const loader = await loaderPromise;\n-    return loader.import(specifier, normalizeReferrerURL(referrer));\n-  });\n-\n   exports.ESMLoader = ESMLoader;\n };\n+\n+const config = process.binding('config');\n+if (config.experimentalModules || config.experimentalVMModules) {\n+  setInitializeImportMetaObjectCallback((wrap, meta) => {\n+    if (wrap.initializeImportMeta !== undefined)\n+      wrap.initializeImportMeta(meta);\n+  });\n+\n+  setImportModuleDynamicallyCallback(async (referrer, specifier, wrap) => {\n+    if (wrap !== undefined && wrap.importModuleDynamically !== undefined)\n+      return wrap.importModuleDynamically(specifier);","path":"lib/internal/process/esm_loader.js","position":71,"original_position":71,"commit_id":"10ae336a712ee8d8f37dca4caf555c1a21badd91","original_commit_id":"10ae336a712ee8d8f37dca4caf555c1a21badd91","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":"users can't touch ModuleWrap instances and even if they could they're frozen. I'll look into scripts when I have a free moment.","created_at":"2018-04-06T14:39:23Z","updated_at":"2018-04-06T14:39:23Z","html_url":"https://github.com/nodejs/node/pull/19717#discussion_r179778325","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/179778325"},"html":{"href":"https://github.com/nodejs/node/pull/19717#discussion_r179778325"},"pull_request":{"href":"https://api.github.com/repos/nodejs/node/pulls/19717"}},"in_reply_to_id":179770441},"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-06T14:39:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd178bcbeaa3eb755c4513e937396f88b9655a63","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},{"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}],"requested_teams":[],"labels":[{"id":690799345,"url":"https://api.github.com/repos/nodejs/node/labels/ES%20Modules","name":"ES Modules","color":"0052cc","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/10ae336a712ee8d8f37dca4caf555c1a21badd91","head":{"label":"devsnek:refactor/module-callbacks","ref":"refactor/module-callbacks","sha":"10ae336a712ee8d8f37dca4caf555c1a21badd91","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-06T13:44:30Z","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":318778,"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":"fdb35d89605de642f316563cd552f930e06ac306","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-06T14:28:34Z","pushed_at":"2018-04-06T14:07:27Z","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":363229,"stargazers_count":47281,"watchers_count":47281,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":9923,"mirror_url":null,"archived":false,"open_issues_count":847,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":9923,"open_issues":847,"watchers":47281,"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/10ae336a712ee8d8f37dca4caf555c1a21badd91"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"devsnek"}}