{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/52550365","id":52550365,"diff_hunk":"@@ -11,6 +11,7 @@\n     JsGetContextData\n     JsSetContextData\n     JsRunScript\n+    JsExperimentalRunModule","path":"lib/jsrt/JsrtCommonExports.inc","position":4,"original_position":4,"commit_id":"837897cac06bfd1ed50d64d45cfde4ca2708ce3d","original_commit_id":"837897cac06bfd1ed50d64d45cfde4ca2708ce3d","user":{"login":"ianwjhalliday","id":906649,"avatar_url":"https://avatars.githubusercontent.com/u/906649?v=3","gravatar_id":"","url":"https://api.github.com/users/ianwjhalliday","html_url":"https://github.com/ianwjhalliday","followers_url":"https://api.github.com/users/ianwjhalliday/followers","following_url":"https://api.github.com/users/ianwjhalliday/following{/other_user}","gists_url":"https://api.github.com/users/ianwjhalliday/gists{/gist_id}","starred_url":"https://api.github.com/users/ianwjhalliday/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianwjhalliday/subscriptions","organizations_url":"https://api.github.com/users/ianwjhalliday/orgs","repos_url":"https://api.github.com/users/ianwjhalliday/repos","events_url":"https://api.github.com/users/ianwjhalliday/events{/privacy}","received_events_url":"https://api.github.com/users/ianwjhalliday/received_events","type":"User","site_admin":false},"body":"I kinda want this to be named `JsExperimentalApiRunModule` so that the self reference is clear and unambiguous.  What do you think?","created_at":"2016-02-11T00:32:22Z","updated_at":"2016-02-11T00:32:22Z","html_url":"https://github.com/Microsoft/ChakraCore/pull/293#discussion_r52550365","pull_request_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments/52550365"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/293#discussion_r52550365"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293","id":58963772,"html_url":"https://github.com/Microsoft/ChakraCore/pull/293","diff_url":"https://github.com/Microsoft/ChakraCore/pull/293.diff","patch_url":"https://github.com/Microsoft/ChakraCore/pull/293.patch","issue_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/293","number":293,"state":"open","locked":false,"title":"Add parser support for ES6 module feature","user":{"login":"boingoing","id":1569843,"avatar_url":"https://avatars.githubusercontent.com/u/1569843?v=3","gravatar_id":"","url":"https://api.github.com/users/boingoing","html_url":"https://github.com/boingoing","followers_url":"https://api.github.com/users/boingoing/followers","following_url":"https://api.github.com/users/boingoing/following{/other_user}","gists_url":"https://api.github.com/users/boingoing/gists{/gist_id}","starred_url":"https://api.github.com/users/boingoing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/boingoing/subscriptions","organizations_url":"https://api.github.com/users/boingoing/orgs","repos_url":"https://api.github.com/users/boingoing/repos","events_url":"https://api.github.com/users/boingoing/events{/privacy}","received_events_url":"https://api.github.com/users/boingoing/received_events","type":"User","site_admin":false},"body":"Initial support for handling import and export statements in the Chakra\nparser. It is gated behind a config flag (-ES6Module).\n\nWe are treating the import and export keywords like a tag for declarations\nor identifier references which should be physically stored in a special\nslot array which we need to build up at module link time (or, at least\nbefore bytecode generation time). The array is not built up as part of\nthis change but we are collecting all the exports, imports, and referenced\nmodules such that building that array should be possible. Once we build\nthis array, accesses to identifiers which are created via an import\nkeyword will load from that slot array and accesses to identifiers\ndeclared via an export keyword will load and store from the same slot\narray.\n\nCurrently, we are not hooking up export declarations to their imported\nusages. If you import a binding from another module and access it, we will\nonly guarantee that the binding exists. The value of the binding will\nalways be undefined.\n\nWe are keeping track of exports, imports, and referenced modules in the\ntop-level ParseNode of the parser (which is subsequently handed-off to the\nByteCodeGenerator). When parsing a module we set a flag (fscrIsModuleCode)\nwhich also causes us to create the root ParseNode as a knopModule type\nnode. That is in turn used to allocate the ParseNode itself as a PnModule\nnode, which derives from PnProg but adds the lists for imports, exports,\nand referenced modules. We are still treating the top-level ParseNode as a\nknopProg (which is to say, we reset the nop to knopProg after allocating\nit) because we handle the case of knopProg everywhere and we don't need to\ncomplicate things by also needing to handle knopModule. Instead we just\nuse the PnModule extensions when we are in a module-specific parsing path\nand otherwise treat the node as if it was a PnProg ParseNode anyway. Note\nthat import and export statements do not themselves have special ParseNode\ntypes.\n\nThis change adds an experimental method to Jsrt (JsExperimentalRunModule)\nand a ch.exe hook (WScript.LoadModuleFile) for loading a module from a\nfile. Loading a module via this hook acts similarly to including a module\nin a script tag like <script type=\"module\">. The experimental method is\nsubject to change as the feature evolves.\n\nA couple of points about module code. Module code is always strict code.\nImport and export statements may only occur as statements at global scope\n- they may not be located inside functions or inside eval'd code.\n\nFor more information about ES6 modules, please see the spec\nhttp://tc39.github.io/ecma262/#sec-modules.\n","created_at":"2016-02-10T22:23:12Z","updated_at":"2016-02-11T00:32:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71b033dd3e221d15f337f811c9e1c15f18e6afc7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293/commits","review_comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293/comments","review_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/293/comments","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/837897cac06bfd1ed50d64d45cfde4ca2708ce3d","head":{"label":"Microsoft:pr/boingoing/moduleparsercore","ref":"pr/boingoing/moduleparsercore","sha":"837897cac06bfd1ed50d64d45cfde4ca2708ce3d","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":49086513,"name":"ChakraCore","full_name":"Microsoft/ChakraCore","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":false,"url":"https://api.github.com/repos/Microsoft/ChakraCore","forks_url":"https://api.github.com/repos/Microsoft/ChakraCore/forks","keys_url":"https://api.github.com/repos/Microsoft/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/ChakraCore/teams","hooks_url":"https://api.github.com/repos/Microsoft/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/events","assignees_url":"https://api.github.com/repos/Microsoft/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/tags","blobs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/Microsoft/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscription","commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/ChakraCore/merges","archive_url":"https://api.github.com/repos/Microsoft/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/ChakraCore/downloads","issues_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/ChakraCore/deployments","created_at":"2016-01-05T19:05:31Z","updated_at":"2016-02-10T21:03:55Z","pushed_at":"2016-02-11T00:15:36Z","git_url":"git://github.com/Microsoft/ChakraCore.git","ssh_url":"git@github.com:Microsoft/ChakraCore.git","clone_url":"https://github.com/Microsoft/ChakraCore.git","svn_url":"https://github.com/Microsoft/ChakraCore","homepage":null,"size":19598,"stargazers_count":4838,"watchers_count":4838,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":480,"mirror_url":null,"open_issues_count":70,"forks":480,"open_issues":70,"watchers":4838,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"fff4b616904dcb51181b459244b8c42fb1591300","user":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":49086513,"name":"ChakraCore","full_name":"Microsoft/ChakraCore","owner":{"login":"Microsoft","id":6154722,"avatar_url":"https://avatars.githubusercontent.com/u/6154722?v=3","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Microsoft/ChakraCore","description":"ChakraCore is the core part of the Chakra Javascript engine that powers Microsoft Edge","fork":false,"url":"https://api.github.com/repos/Microsoft/ChakraCore","forks_url":"https://api.github.com/repos/Microsoft/ChakraCore/forks","keys_url":"https://api.github.com/repos/Microsoft/ChakraCore/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/ChakraCore/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/ChakraCore/teams","hooks_url":"https://api.github.com/repos/Microsoft/ChakraCore/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/ChakraCore/events","assignees_url":"https://api.github.com/repos/Microsoft/ChakraCore/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/ChakraCore/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/tags","blobs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/ChakraCore/languages","stargazers_url":"https://api.github.com/repos/Microsoft/ChakraCore/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/ChakraCore/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/ChakraCore/subscription","commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/ChakraCore/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/ChakraCore/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/ChakraCore/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/ChakraCore/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/ChakraCore/merges","archive_url":"https://api.github.com/repos/Microsoft/ChakraCore/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/ChakraCore/downloads","issues_url":"https://api.github.com/repos/Microsoft/ChakraCore/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/ChakraCore/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/ChakraCore/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/ChakraCore/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/ChakraCore/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/ChakraCore/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/ChakraCore/deployments","created_at":"2016-01-05T19:05:31Z","updated_at":"2016-02-10T21:03:55Z","pushed_at":"2016-02-11T00:15:36Z","git_url":"git://github.com/Microsoft/ChakraCore.git","ssh_url":"git@github.com:Microsoft/ChakraCore.git","clone_url":"https://github.com/Microsoft/ChakraCore.git","svn_url":"https://github.com/Microsoft/ChakraCore","homepage":null,"size":19598,"stargazers_count":4838,"watchers_count":4838,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":480,"mirror_url":null,"open_issues_count":70,"forks":480,"open_issues":70,"watchers":4838,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293"},"html":{"href":"https://github.com/Microsoft/ChakraCore/pull/293"},"issue":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/293"},"comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/issues/293/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/pulls/293/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/ChakraCore/statuses/837897cac06bfd1ed50d64d45cfde4ca2708ce3d"}}}}