{"action":"created","issue":{"url":"https://api.github.com/repos/tc39/ecma262/issues/275","labels_url":"https://api.github.com/repos/tc39/ecma262/issues/275/labels{/name}","comments_url":"https://api.github.com/repos/tc39/ecma262/issues/275/comments","events_url":"https://api.github.com/repos/tc39/ecma262/issues/275/events","html_url":"https://github.com/tc39/ecma262/pull/275","id":123565932,"number":275,"title":"Editorial: be explicit about parsing realms","user":{"login":"domenic","id":617481,"avatar_url":"https://avatars.githubusercontent.com/u/617481?v=3","gravatar_id":"","url":"https://api.github.com/users/domenic","html_url":"https://github.com/domenic","followers_url":"https://api.github.com/users/domenic/followers","following_url":"https://api.github.com/users/domenic/following{/other_user}","gists_url":"https://api.github.com/users/domenic/gists{/gist_id}","starred_url":"https://api.github.com/users/domenic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenic/subscriptions","organizations_url":"https://api.github.com/users/domenic/orgs","repos_url":"https://api.github.com/users/domenic/repos","events_url":"https://api.github.com/users/domenic/events{/privacy}","received_events_url":"https://api.github.com/users/domenic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-12-22T22:12:53Z","updated_at":"2015-12-27T18:31:46Z","closed_at":"2015-12-27T14:23:04Z","pull_request":{"url":"https://api.github.com/repos/tc39/ecma262/pulls/275","html_url":"https://github.com/tc39/ecma262/pull/275","diff_url":"https://github.com/tc39/ecma262/pull/275.diff","patch_url":"https://github.com/tc39/ecma262/pull/275.patch"},"body":"When creating script and module records via ParseScript/ParseModule, currently we always use the running execution context's Realm. This pushes the dependency on the current execution context out a level, to the top-level jobs, ensuring that the parsing operations do not depend on implicit global state and can be used without a running execution context.\r\n\r\n--\r\n\r\nThis is not a big deal, but as explained above it seems like an improvement. Incidentally (not primarily), it allows HTML to avoid the awkward dance of:\r\n\r\n1. Look up _realm execution context_, an execution context corresponding to the desired Realm _realm_.\r\n1. Push _realm execution context_ onto the execution context stack.\r\n1. Let _s_ be ParseScript(_sourceText_, _hostDefined_).\r\n1. Remove _realm execution context_ from the execution context stack\r\n\r\nin favor of the simpler\r\n\r\n1. Let _s_ be ParseScript(_sourceText_, _realm_, _hostDefined_).\r\n\r\nI labeled this as \"editorial\" instead of \"layering\" since IMO it's a solid editorial change independent of incidental layering benefits. \"Layering\" seems more for changes that are necessary for layering work.\r\n\r\n---\r\n\r\nAn alternate design would be to not pass _realm_ to ParseScript/ParseModule at all and instead have their callers (whether the callers be HTML or ScriptEvaluationJob/TopLevelModuleEvaluationJob) set _returnedScript_.[[Realm]]. The same goes for _hostDefined_ actually. But it seems kind of nicer to have ParseScript/ParseModule return fully-formed records."},"comment":{"url":"https://api.github.com/repos/tc39/ecma262/issues/comments/167432888","html_url":"https://github.com/tc39/ecma262/pull/275#issuecomment-167432888","issue_url":"https://api.github.com/repos/tc39/ecma262/issues/275","id":167432888,"user":{"login":"ljharb","id":45469,"avatar_url":"https://avatars.githubusercontent.com/u/45469?v=3","gravatar_id":"","url":"https://api.github.com/users/ljharb","html_url":"https://github.com/ljharb","followers_url":"https://api.github.com/users/ljharb/followers","following_url":"https://api.github.com/users/ljharb/following{/other_user}","gists_url":"https://api.github.com/users/ljharb/gists{/gist_id}","starred_url":"https://api.github.com/users/ljharb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ljharb/subscriptions","organizations_url":"https://api.github.com/users/ljharb/orgs","repos_url":"https://api.github.com/users/ljharb/repos","events_url":"https://api.github.com/users/ljharb/events{/privacy}","received_events_url":"https://api.github.com/users/ljharb/received_events","type":"User","site_admin":false},"created_at":"2015-12-27T18:31:45Z","updated_at":"2015-12-27T18:31:45Z","body":"@abdulhannanali that's highly inappropriate and unnecessary."}}