Implemented suggested changes.

This commit is contained in:
Cameron Martin
2018-11-27 09:12:09 +00:00
parent 9f4587cc67
commit ebb397fb9e
2 changed files with 5 additions and 5 deletions
@@ -89,7 +89,8 @@ const v1: Visitor = {
const id = path.scope.generateUidIdentifierBasedOnNode(path.node.id!);
path.remove();
path.scope.parent.push({ id, init: path.node });
path.scope.parent.push({ id });
path.scope.parent.push({ id, init: t.stringLiteral('foo'), kind: "const" });
path.scope.rename("n", "x");
path.scope.rename("n");
+3 -4
View File
@@ -91,11 +91,10 @@ export class Scope {
removeData(key: string): void;
push(opts: {
id: object,
init?: object,
id: t.LVal,
init?: t.Expression,
unique?: boolean,
_blockHoist?: number,
kind?: "var" | "let",
kind?: "var" | "let" | "const",
}): void;
getProgramParent(): Scope;