Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Closed
Description
Suggestion
In#9211: we are planning to enforce the following invariants in our AST forVariableDeclaration, specifically the declarators indeclarations:
definitecan only be true ifdeclare: falseandkind: "let" | "var", so the following are all parsing errors:constx!=1;declareletx!:string;
- If
definite: true, theninit: null, and the identifier has a type annotation:letx!=1;letx!;
- If
declare: trueandkind: "let" | "var", theninit: null:declareletx=1;
- If
declare: falseandkind: "const"theninitis non-null:constx;
@sosukesuzuki@fisker Do these look safe to you?