{"action":"created","issue":{"url":"https://api.github.com/repos/binast/ecmascript-binary-ast/issues/40","repository_url":"https://api.github.com/repos/binast/ecmascript-binary-ast","labels_url":"https://api.github.com/repos/binast/ecmascript-binary-ast/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/binast/ecmascript-binary-ast/issues/40/comments","events_url":"https://api.github.com/repos/binast/ecmascript-binary-ast/issues/40/events","html_url":"https://github.com/binast/ecmascript-binary-ast/issues/40","id":328941330,"node_id":"MDU6SXNzdWUzMjg5NDEzMzA=","number":40,"title":"AssertedVarScope needs the actual kind of each name","user":{"login":"arai-a","id":6299746,"node_id":"MDQ6VXNlcjYyOTk3NDY=","avatar_url":"https://avatars1.githubusercontent.com/u/6299746?v=4","gravatar_id":"","url":"https://api.github.com/users/arai-a","html_url":"https://github.com/arai-a","followers_url":"https://api.github.com/users/arai-a/followers","following_url":"https://api.github.com/users/arai-a/following{/other_user}","gists_url":"https://api.github.com/users/arai-a/gists{/gist_id}","starred_url":"https://api.github.com/users/arai-a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/arai-a/subscriptions","organizations_url":"https://api.github.com/users/arai-a/orgs","repos_url":"https://api.github.com/users/arai-a/repos","events_url":"https://api.github.com/users/arai-a/events{/privacy}","received_events_url":"https://api.github.com/users/arai-a/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-04T07:39:03Z","updated_at":"2018-06-04T21:55:02Z","closed_at":null,"author_association":"NONE","body":"Currently AssertedVarScope has the following structure:\r\n```\r\ninterface AssertedVarScope {\r\n  // checked eagerly during transformation\r\n  attribute FrozenArray<IdentifierName> lexicallyDeclaredNames;\r\n  attribute FrozenArray<IdentifierName> varDeclaredNames;\r\n\r\n  // checked lazily as inner functions are invoked\r\n  attribute FrozenArray<IdentifierName> capturedNames;\r\n  attribute boolean hasDirectEval;\r\n};\r\n```\r\n\r\nSo at least it doesn't distinguish between `let` and `const`.\r\n\r\nThis is troublesome for streaming compilation because the type of each name is unknown until we hit VariableDeclaration, which can appear later in the statement list. (there can be many another statements before it), and we cannot create efficient representation of the scope until hitting all of them.\r\n\r\nAlso, it would be nice if it also distinguish between `var` and `function`, which might be too-SpiderMonkey specific tho.\r\n"},"comment":{"url":"https://api.github.com/repos/binast/ecmascript-binary-ast/issues/comments/394512828","html_url":"https://github.com/binast/ecmascript-binary-ast/issues/40#issuecomment-394512828","issue_url":"https://api.github.com/repos/binast/ecmascript-binary-ast/issues/40","id":394512828,"node_id":"MDEyOklzc3VlQ29tbWVudDM5NDUxMjgyOA==","user":{"login":"syg","id":95697,"node_id":"MDQ6VXNlcjk1Njk3","avatar_url":"https://avatars3.githubusercontent.com/u/95697?v=4","gravatar_id":"","url":"https://api.github.com/users/syg","html_url":"https://github.com/syg","followers_url":"https://api.github.com/users/syg/followers","following_url":"https://api.github.com/users/syg/following{/other_user}","gists_url":"https://api.github.com/users/syg/gists{/gist_id}","starred_url":"https://api.github.com/users/syg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syg/subscriptions","organizations_url":"https://api.github.com/users/syg/orgs","repos_url":"https://api.github.com/users/syg/repos","events_url":"https://api.github.com/users/syg/events{/privacy}","received_events_url":"https://api.github.com/users/syg/received_events","type":"User","site_admin":false},"created_at":"2018-06-04T21:55:02Z","updated_at":"2018-06-04T21:55:02Z","author_association":"COLLABORATOR","body":"The intention of the `AssertedScope`s is to have the minimal amount of information needed to enable computing binding locations (i.e. frame or environment slots) and accesses to those binding locations ahead of time.\r\n\r\nDistinguishing non-`const` from `const` is strictly not needed, because any access to the `const` before the actual declaration is encountered is a TDZ error, and thus do not need to distinguish `const` from non-`const`. That said, non-`const` vs `const` seems useful to know ahead of time since an implementation could reasonably choose to put consts elsewhere than other lexical bindings.\r\n\r\nAlso, I'll probably rename let names to nonConstLexical or something, in that there are other lexical bindings that aren't `let` forms.\r\n\r\nDistinguishing `class`es and top-level functions are harder to justify. For better error messages with classes in SM, you can add a new `DeclarationKind` for classes."}}
{"actor":{"display_login":"syg"}}