-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AssertedVarScope needs the actual kind of each name #40
Comments
|
(first post on microsoft github, odd) Yeah, that would make sense. We could have an
and then rewrite
etc. |
also, adding |
The intention of the Distinguishing non- Also, I'll probably rename let names to nonConstLexical or something, in that there are other lexical bindings that aren't Distinguishing |
I'm not sure how other implementations handle slot and declaration kind tho,
it's already added, and works when we hit redeclaration in the single compilation unit. what I intended is the case that redeclaration happens across 2 compilation unit. |
Right, I originally designed it that way as a packed representation. At the cost of memory, you can imagine a scope having an array of pairs of (name, kind). The only real constraints at the time when I originally designed it was that all lexical bindings should be in a contiguous range, so that we can TDZ an entire range instead of one slot at a time. I agree fixing up would be really gross. I'm fine with adding the let/const distinction since it's pretty fundamental to the language. Other additions you want to add to |
@arai-a I have pushed a refactoring of asserted scoeps to https://binast.github.io/ecmascript-binary-ast/ Search for "AssertedDeclaredKind", and check out the updated CheckAssertedScope Abstract Operation. I've also added an Let me know if you think this'll work for you. |
Thanks! |
Fortunately, the So, I think the change works :) |
Currently AssertedVarScope has the following structure:
So at least it doesn't distinguish between
let
andconst
.This 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.
Also, it would be nice if it also distinguish between
var
andfunction
, which might be too-SpiderMonkey specific tho.The text was updated successfully, but these errors were encountered: