aoc/node_modules/@babel/traverse/lib/scope/index.js.map

1 line
67 KiB
Plaintext

{"version":3,"names":["NOT_LOCAL_BINDING","callExpression","cloneNode","getBindingIdentifiers","identifier","isArrayExpression","isBinary","isClass","isClassBody","isClassDeclaration","isExportAllDeclaration","isExportDefaultDeclaration","isExportNamedDeclaration","isFunctionDeclaration","isIdentifier","isImportDeclaration","isLiteral","isMethod","isModuleDeclaration","isModuleSpecifier","isNullLiteral","isObjectExpression","isProperty","isPureish","isRegExpLiteral","isSuper","isTaggedTemplateExpression","isTemplateLiteral","isThisExpression","isUnaryExpression","isVariableDeclaration","matchesPattern","memberExpression","numericLiteral","toIdentifier","unaryExpression","variableDeclaration","variableDeclarator","isRecordExpression","isTupleExpression","isObjectProperty","isTopicReference","isMetaProperty","isPrivateName","gatherNodeParts","node","parts","type","source","specifiers","length","e","declaration","local","push","value","object","property","name","callee","properties","argument","key","left","id","expression","meta","openingElement","openingFragment","namespace","collectorVisitor","ForStatement","path","declar","get","isVar","scope","parentScope","getFunctionParent","getProgramParent","registerBinding","Declaration","isBlockScoped","isExportDeclaration","parent","registerDeclaration","ImportDeclaration","getBlockParent","ReferencedIdentifier","state","references","ForXStatement","isPattern","constantViolations","ExportDeclaration","exit","binding","getBinding","reference","decl","declarations","Object","keys","LabeledStatement","AssignmentExpression","assignments","UpdateExpression","UnaryExpression","operator","BlockScoped","bindings","CatchClause","Function","params","param","isFunctionExpression","has","ClassExpression","uid","Scope","constructor","block","labels","inited","globals","uids","data","crawling","cached","scopeCache","set","Map","shouldSkip","listKey","parentPath","isScope","parentBlock","hub","traverse","opts","generateDeclaredUidIdentifier","generateUidIdentifier","generateUid","replace","i","_generateUid","hasLabel","hasBinding","hasGlobal","hasReference","program","generateUidBasedOnNode","defaultName","join","slice","generateUidIdentifierBasedOnNode","isStatic","constant","maybeGenerateMemoised","dontPush","checkBlockScopedCollisions","kind","duplicate","buildError","TypeError","rename","oldName","newName","Renamer","_renameFromMap","map","dump","sep","repeat","console","log","violations","toArray","arrayLikeIsIterable","isGenericType","helperName","args","unshift","addHelper","getLabel","registerLabel","label","isLabeledStatement","declare","specifier","buildUndefinedNode","registerConstantViolation","ids","reassign","bindingPath","ReferenceError","declarators","getOuterBindingIdentifiers","getOwnBinding","Binding","addGlobal","hasUid","isPure","constantsOnly","superClass","decorators","body","method","right","elem","elements","prop","computed","static","tag","quasi","expressions","setData","val","getData","removeData","init","crawl","create","programParent","_exploded","visit","enter","typeVisitors","ref","getPatternParent","isBlockStatement","isProgram","isSwitchStatement","isLoop","isCatchClause","isFunction","ensureBlock","unique","blockHoist","_blockHoist","dataKey","declarPath","unshiftContainer","declarator","len","Error","isFunctionParent","isBlockParent","getAllBindings","getAllBindingsOfKind","kinds","bindingIdentifierEquals","getBindingIdentifier","previousPath","isArrowFunctionExpression","getOwnBindingIdentifier","hasOwnBinding","noGlobals","parentHasBinding","includes","contextVariables","moveBindingTo","info","removeOwnBinding","removeBinding","builtin"],"sources":["../../src/scope/index.ts"],"sourcesContent":["import Renamer from \"./lib/renamer\";\nimport type NodePath from \"../path\";\nimport traverse from \"../index\";\nimport type { TraverseOptions } from \"../index\";\nimport Binding from \"./binding\";\nimport type { BindingKind } from \"./binding\";\nimport globals from \"globals\";\nimport {\n NOT_LOCAL_BINDING,\n callExpression,\n cloneNode,\n getBindingIdentifiers,\n identifier,\n isArrayExpression,\n isBinary,\n isClass,\n isClassBody,\n isClassDeclaration,\n isExportAllDeclaration,\n isExportDefaultDeclaration,\n isExportNamedDeclaration,\n isFunctionDeclaration,\n isIdentifier,\n isImportDeclaration,\n isLiteral,\n isMethod,\n isModuleDeclaration,\n isModuleSpecifier,\n isNullLiteral,\n isObjectExpression,\n isProperty,\n isPureish,\n isRegExpLiteral,\n isSuper,\n isTaggedTemplateExpression,\n isTemplateLiteral,\n isThisExpression,\n isUnaryExpression,\n isVariableDeclaration,\n matchesPattern,\n memberExpression,\n numericLiteral,\n toIdentifier,\n unaryExpression,\n variableDeclaration,\n variableDeclarator,\n isRecordExpression,\n isTupleExpression,\n isObjectProperty,\n isTopicReference,\n isMetaProperty,\n isPrivateName,\n} from \"@babel/types\";\nimport type * as t from \"@babel/types\";\nimport { scope as scopeCache } from \"../cache\";\nimport type { Visitor } from \"../types\";\n\ntype NodePart = string | number | boolean;\n// Recursively gathers the identifying names of a node.\nfunction gatherNodeParts(node: t.Node, parts: NodePart[]) {\n switch (node?.type) {\n default:\n if (isModuleDeclaration(node)) {\n if (\n (isExportAllDeclaration(node) ||\n isExportNamedDeclaration(node) ||\n isImportDeclaration(node)) &&\n node.source\n ) {\n gatherNodeParts(node.source, parts);\n } else if (\n (isExportNamedDeclaration(node) || isImportDeclaration(node)) &&\n node.specifiers &&\n node.specifiers.length\n ) {\n for (const e of node.specifiers) gatherNodeParts(e, parts);\n } else if (\n (isExportDefaultDeclaration(node) ||\n isExportNamedDeclaration(node)) &&\n node.declaration\n ) {\n gatherNodeParts(node.declaration, parts);\n }\n } else if (isModuleSpecifier(node)) {\n // todo(flow->ts): should condition instead be:\n // ```\n // t.isExportSpecifier(node) ||\n // t.isImportDefaultSpecifier(node) ||\n // t.isImportNamespaceSpecifier(node) ||\n // t.isImportSpecifier(node)\n // ```\n // allowing only nodes with `.local`?\n // @ts-expect-error todo(flow->ts)\n gatherNodeParts(node.local, parts);\n } else if (\n isLiteral(node) &&\n !isNullLiteral(node) &&\n !isRegExpLiteral(node) &&\n !isTemplateLiteral(node)\n ) {\n parts.push(node.value);\n }\n break;\n\n case \"MemberExpression\":\n case \"OptionalMemberExpression\":\n case \"JSXMemberExpression\":\n gatherNodeParts(node.object, parts);\n gatherNodeParts(node.property, parts);\n break;\n\n case \"Identifier\":\n case \"JSXIdentifier\":\n parts.push(node.name);\n break;\n\n case \"CallExpression\":\n case \"OptionalCallExpression\":\n case \"NewExpression\":\n gatherNodeParts(node.callee, parts);\n break;\n\n case \"ObjectExpression\":\n case \"ObjectPattern\":\n for (const e of node.properties) {\n gatherNodeParts(e, parts);\n }\n break;\n\n case \"SpreadElement\":\n case \"RestElement\":\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"ObjectProperty\":\n case \"ObjectMethod\":\n case \"ClassProperty\":\n case \"ClassMethod\":\n case \"ClassPrivateProperty\":\n case \"ClassPrivateMethod\":\n gatherNodeParts(node.key, parts);\n break;\n\n case \"ThisExpression\":\n parts.push(\"this\");\n break;\n\n case \"Super\":\n parts.push(\"super\");\n break;\n\n case \"Import\":\n parts.push(\"import\");\n break;\n\n case \"DoExpression\":\n parts.push(\"do\");\n break;\n\n case \"YieldExpression\":\n parts.push(\"yield\");\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"AwaitExpression\":\n parts.push(\"await\");\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"AssignmentExpression\":\n gatherNodeParts(node.left, parts);\n break;\n\n case \"VariableDeclarator\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"FunctionExpression\":\n case \"FunctionDeclaration\":\n case \"ClassExpression\":\n case \"ClassDeclaration\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"PrivateName\":\n gatherNodeParts(node.id, parts);\n break;\n\n case \"ParenthesizedExpression\":\n gatherNodeParts(node.expression, parts);\n break;\n\n case \"UnaryExpression\":\n case \"UpdateExpression\":\n gatherNodeParts(node.argument, parts);\n break;\n\n case \"MetaProperty\":\n gatherNodeParts(node.meta, parts);\n gatherNodeParts(node.property, parts);\n break;\n\n case \"JSXElement\":\n gatherNodeParts(node.openingElement, parts);\n break;\n\n case \"JSXOpeningElement\":\n gatherNodeParts(node.name, parts);\n break;\n\n case \"JSXFragment\":\n gatherNodeParts(node.openingFragment, parts);\n break;\n\n case \"JSXOpeningFragment\":\n parts.push(\"Fragment\");\n break;\n\n case \"JSXNamespacedName\":\n gatherNodeParts(node.namespace, parts);\n gatherNodeParts(node.name, parts);\n break;\n }\n}\n\n//\ninterface CollectVisitorState {\n assignments: NodePath<t.AssignmentExpression>[];\n references: NodePath<t.Identifier | t.JSXIdentifier>[];\n constantViolations: NodePath[];\n}\n\nconst collectorVisitor: Visitor<CollectVisitorState> = {\n ForStatement(path) {\n const declar = path.get(\"init\");\n // delegate block scope handling to the `BlockScoped` method\n if (declar.isVar()) {\n const { scope } = path;\n const parentScope = scope.getFunctionParent() || scope.getProgramParent();\n parentScope.registerBinding(\"var\", declar);\n }\n },\n\n Declaration(path) {\n // delegate block scope handling to the `BlockScoped` method\n if (path.isBlockScoped()) return;\n\n // delegate import handing to the `ImportDeclaration` method\n if (path.isImportDeclaration()) return;\n\n // this will be hit again once we traverse into it after this iteration\n if (path.isExportDeclaration()) return;\n\n // we've ran into a declaration!\n const parent =\n path.scope.getFunctionParent() || path.scope.getProgramParent();\n parent.registerDeclaration(path);\n },\n\n ImportDeclaration(path) {\n // import may only appear in the top level or inside a module/namespace (for TS/flow)\n const parent = path.scope.getBlockParent();\n\n parent.registerDeclaration(path);\n },\n\n ReferencedIdentifier(path, state) {\n state.references.push(path);\n },\n\n ForXStatement(path, state) {\n const left = path.get(\"left\");\n if (left.isPattern() || left.isIdentifier()) {\n state.constantViolations.push(path);\n }\n // delegate block scope handling to the `BlockScoped` method\n else if (left.isVar()) {\n const { scope } = path;\n const parentScope = scope.getFunctionParent() || scope.getProgramParent();\n parentScope.registerBinding(\"var\", left);\n }\n },\n\n ExportDeclaration: {\n exit(path) {\n const { node, scope } = path;\n // ExportAllDeclaration does not have `declaration`\n if (isExportAllDeclaration(node)) return;\n const declar = node.declaration;\n if (isClassDeclaration(declar) || isFunctionDeclaration(declar)) {\n const id = declar.id;\n if (!id) return;\n\n const binding = scope.getBinding(id.name);\n binding?.reference(path);\n } else if (isVariableDeclaration(declar)) {\n for (const decl of declar.declarations) {\n for (const name of Object.keys(getBindingIdentifiers(decl))) {\n const binding = scope.getBinding(name);\n binding?.reference(path);\n }\n }\n }\n },\n },\n\n LabeledStatement(path) {\n path.scope.getBlockParent().registerDeclaration(path);\n },\n\n AssignmentExpression(path, state) {\n state.assignments.push(path);\n },\n\n UpdateExpression(path, state) {\n state.constantViolations.push(path);\n },\n\n UnaryExpression(path, state) {\n if (path.node.operator === \"delete\") {\n state.constantViolations.push(path);\n }\n },\n\n BlockScoped(path) {\n let scope = path.scope;\n if (scope.path === path) scope = scope.parent;\n\n const parent = scope.getBlockParent();\n parent.registerDeclaration(path);\n\n // Register class identifier in class' scope if this is a class declaration.\n if (path.isClassDeclaration() && path.node.id) {\n const id = path.node.id;\n const name = id.name;\n\n path.scope.bindings[name] = path.scope.parent.getBinding(name);\n }\n },\n\n CatchClause(path) {\n path.scope.registerBinding(\"let\", path);\n },\n\n Function(path) {\n const params: Array<NodePath> = path.get(\"params\");\n for (const param of params) {\n path.scope.registerBinding(\"param\", param);\n }\n\n // Register function expression id after params. When the id\n // collides with a function param, the id effectively can't be\n // referenced: here we registered it as a constantViolation\n if (\n path.isFunctionExpression() &&\n path.has(\"id\") &&\n // @ts-expect-error Fixme: document symbol ast properties\n !path.get(\"id\").node[NOT_LOCAL_BINDING]\n ) {\n path.scope.registerBinding(\"local\", path.get(\"id\"), path);\n }\n },\n\n ClassExpression(path) {\n if (\n path.has(\"id\") &&\n // @ts-expect-error Fixme: document symbol ast properties\n !path.get(\"id\").node[NOT_LOCAL_BINDING]\n ) {\n path.scope.registerBinding(\"local\", path);\n }\n },\n};\n\nlet uid = 0;\n\nexport type { Binding };\n\nexport default class Scope {\n uid;\n\n path: NodePath;\n block: t.Pattern | t.Scopable;\n\n labels;\n inited;\n\n bindings: { [name: string]: Binding };\n references: { [name: string]: true };\n globals: { [name: string]: t.Identifier | t.JSXIdentifier };\n uids: { [name: string]: boolean };\n data: { [key: string | symbol]: unknown };\n crawling: boolean;\n\n /**\n * This searches the current \"scope\" and collects all references/bindings\n * within.\n */\n constructor(path: NodePath<t.Pattern | t.Scopable>) {\n const { node } = path;\n const cached = scopeCache.get(node);\n // Sometimes, a scopable path is placed higher in the AST tree.\n // In these cases, have to create a new Scope.\n if (cached?.path === path) {\n return cached;\n }\n scopeCache.set(node, this);\n\n this.uid = uid++;\n\n this.block = node;\n this.path = path;\n\n this.labels = new Map();\n this.inited = false;\n }\n\n /**\n * Globals.\n */\n\n static globals = Object.keys(globals.builtin);\n\n /**\n * Variables available in current context.\n */\n\n static contextVariables = [\"arguments\", \"undefined\", \"Infinity\", \"NaN\"];\n\n get parent() {\n let parent,\n path = this.path;\n do {\n // Skip method scope if coming from inside computed key or decorator expression\n const shouldSkip = path.key === \"key\" || path.listKey === \"decorators\";\n path = path.parentPath;\n if (shouldSkip && path.isMethod()) path = path.parentPath;\n if (path && path.isScope()) parent = path;\n } while (path && !parent);\n\n return parent?.scope;\n }\n\n get parentBlock() {\n return this.path.parent;\n }\n\n get hub() {\n return this.path.hub;\n }\n\n traverse<S>(\n node: t.Node | t.Node[],\n opts: TraverseOptions<S>,\n state: S,\n ): void;\n traverse(node: t.Node | t.Node[], opts?: TraverseOptions, state?: any): void;\n /**\n * Traverse node with current scope and path.\n */\n traverse<S>(node: any, opts: any, state?: S) {\n traverse(node, opts, this, state, this.path);\n }\n\n /**\n * Generate a unique identifier and add it to the current scope.\n */\n\n generateDeclaredUidIdentifier(name?: string) {\n const id = this.generateUidIdentifier(name);\n this.push({ id });\n return cloneNode(id);\n }\n\n /**\n * Generate a unique identifier.\n */\n\n generateUidIdentifier(name?: string) {\n return identifier(this.generateUid(name));\n }\n\n /**\n * Generate a unique `_id1` binding.\n */\n\n generateUid(name: string = \"temp\"): string {\n name = toIdentifier(name)\n .replace(/^_+/, \"\")\n .replace(/[0-9]+$/g, \"\");\n\n let uid;\n let i = 1;\n do {\n uid = this._generateUid(name, i);\n i++;\n } while (\n this.hasLabel(uid) ||\n this.hasBinding(uid) ||\n this.hasGlobal(uid) ||\n this.hasReference(uid)\n );\n\n const program = this.getProgramParent();\n program.references[uid] = true;\n program.uids[uid] = true;\n\n return uid;\n }\n\n /**\n * Generate an `_id1`.\n */\n\n _generateUid(name: string, i: number) {\n let id = name;\n if (i > 1) id += i;\n return `_${id}`;\n }\n\n generateUidBasedOnNode(node: t.Node, defaultName?: string) {\n const parts: NodePart[] = [];\n gatherNodeParts(node, parts);\n\n let id = parts.join(\"$\");\n id = id.replace(/^_/, \"\") || defaultName || \"ref\";\n\n return this.generateUid(id.slice(0, 20));\n }\n\n /**\n * Generate a unique identifier based on a node.\n */\n\n generateUidIdentifierBasedOnNode(node: t.Node, defaultName?: string) {\n return identifier(this.generateUidBasedOnNode(node, defaultName));\n }\n\n /**\n * Determine whether evaluating the specific input `node` is a consequenceless reference. ie.\n * evaluating it wont result in potentially arbitrary code from being ran. The following are\n * allowed and determined not to cause side effects:\n *\n * - `this` expressions\n * - `super` expressions\n * - Bound identifiers\n */\n\n isStatic(node: t.Node): boolean {\n if (isThisExpression(node) || isSuper(node) || isTopicReference(node)) {\n return true;\n }\n\n if (isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding) {\n return binding.constant;\n } else {\n return this.hasBinding(node.name);\n }\n }\n\n return false;\n }\n\n /**\n * Possibly generate a memoised identifier if it is not static and has consequences.\n */\n\n maybeGenerateMemoised(node: t.Node, dontPush?: boolean) {\n if (this.isStatic(node)) {\n return null;\n } else {\n const id = this.generateUidIdentifierBasedOnNode(node);\n if (!dontPush) {\n this.push({ id });\n return cloneNode(id);\n }\n return id;\n }\n }\n\n checkBlockScopedCollisions(\n local: Binding,\n kind: BindingKind,\n name: string,\n id: any,\n ) {\n // ignore parameters\n if (kind === \"param\") return;\n\n // Ignore existing binding if it's the name of the current function or\n // class expression\n if (local.kind === \"local\") return;\n\n const duplicate =\n // don't allow duplicate bindings to exist alongside\n kind === \"let\" ||\n local.kind === \"let\" ||\n local.kind === \"const\" ||\n local.kind === \"module\" ||\n // don't allow a local of param with a kind of let\n (local.kind === \"param\" && kind === \"const\");\n\n if (duplicate) {\n throw this.hub.buildError(\n id,\n `Duplicate declaration \"${name}\"`,\n TypeError,\n );\n }\n }\n\n rename(oldName: string, newName?: string, block?: t.Pattern | t.Scopable) {\n const binding = this.getBinding(oldName);\n if (binding) {\n newName = newName || this.generateUidIdentifier(oldName).name;\n return new Renamer(binding, oldName, newName).rename(block);\n }\n }\n\n /** @deprecated Not used in our codebase */\n _renameFromMap(\n map: Record<string | symbol, unknown>,\n oldName: string | symbol,\n newName: string | symbol,\n value: unknown,\n ) {\n if (map[oldName]) {\n map[newName] = value;\n map[oldName] = null;\n }\n }\n\n dump() {\n const sep = \"-\".repeat(60);\n console.log(sep);\n let scope: Scope = this;\n do {\n console.log(\"#\", scope.block.type);\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n console.log(\" -\", name, {\n constant: binding.constant,\n references: binding.references,\n violations: binding.constantViolations.length,\n kind: binding.kind,\n });\n }\n } while ((scope = scope.parent));\n console.log(sep);\n }\n\n // TODO: (Babel 8) Split i in two parameters, and use an object of flags\n toArray(\n node: t.Node,\n i?: number | boolean,\n arrayLikeIsIterable?: boolean | void,\n ) {\n if (isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (binding?.constant && binding.path.isGenericType(\"Array\")) {\n return node;\n }\n }\n\n if (isArrayExpression(node)) {\n return node;\n }\n\n if (isIdentifier(node, { name: \"arguments\" })) {\n return callExpression(\n memberExpression(\n memberExpression(\n memberExpression(identifier(\"Array\"), identifier(\"prototype\")),\n identifier(\"slice\"),\n ),\n identifier(\"call\"),\n ),\n [node],\n );\n }\n\n let helperName;\n const args = [node];\n if (i === true) {\n // Used in array-spread to create an array.\n helperName = \"toConsumableArray\";\n } else if (typeof i === \"number\") {\n args.push(numericLiteral(i));\n\n // Used in array-rest to create an array from a subset of an iterable.\n helperName = \"slicedToArray\";\n // TODO if (this.hub.isLoose(\"es6.forOf\")) helperName += \"-loose\";\n } else {\n // Used in array-rest to create an array\n helperName = \"toArray\";\n }\n\n if (arrayLikeIsIterable) {\n args.unshift(this.hub.addHelper(helperName));\n helperName = \"maybeArrayLike\";\n }\n\n // @ts-expect-error todo(flow->ts): t.Node is not valid to use in args, function argument typeneeds to be clarified\n return callExpression(this.hub.addHelper(helperName), args);\n }\n\n hasLabel(name: string) {\n return !!this.getLabel(name);\n }\n\n getLabel(name: string) {\n return this.labels.get(name);\n }\n\n registerLabel(path: NodePath<t.LabeledStatement>) {\n this.labels.set(path.node.label.name, path);\n }\n\n registerDeclaration(path: NodePath) {\n if (path.isLabeledStatement()) {\n this.registerLabel(path);\n } else if (path.isFunctionDeclaration()) {\n this.registerBinding(\"hoisted\", path.get(\"id\"), path);\n } else if (path.isVariableDeclaration()) {\n const declarations = path.get(\"declarations\");\n const { kind } = path.node;\n for (const declar of declarations) {\n this.registerBinding(kind === \"using\" ? \"const\" : kind, declar);\n }\n } else if (path.isClassDeclaration()) {\n if (path.node.declare) return;\n this.registerBinding(\"let\", path);\n } else if (path.isImportDeclaration()) {\n const specifiers = path.get(\"specifiers\");\n for (const specifier of specifiers) {\n this.registerBinding(\"module\", specifier);\n }\n } else if (path.isExportDeclaration()) {\n // todo: improve babel-types\n const declar = path.get(\"declaration\") as NodePath;\n if (\n declar.isClassDeclaration() ||\n declar.isFunctionDeclaration() ||\n declar.isVariableDeclaration()\n ) {\n this.registerDeclaration(declar);\n }\n } else {\n this.registerBinding(\"unknown\", path);\n }\n }\n\n buildUndefinedNode() {\n return unaryExpression(\"void\", numericLiteral(0), true);\n }\n\n registerConstantViolation(path: NodePath) {\n const ids = path.getBindingIdentifiers();\n for (const name of Object.keys(ids)) {\n const binding = this.getBinding(name);\n if (binding) binding.reassign(path);\n }\n }\n\n registerBinding(\n kind: Binding[\"kind\"],\n path: NodePath,\n bindingPath: NodePath = path,\n ) {\n if (!kind) throw new ReferenceError(\"no `kind`\");\n\n if (path.isVariableDeclaration()) {\n const declarators: Array<NodePath> = path.get(\"declarations\");\n for (const declar of declarators) {\n this.registerBinding(kind, declar);\n }\n return;\n }\n\n const parent = this.getProgramParent();\n const ids = path.getOuterBindingIdentifiers(true);\n\n for (const name of Object.keys(ids)) {\n parent.references[name] = true;\n\n for (const id of ids[name]) {\n const local = this.getOwnBinding(name);\n\n if (local) {\n // same identifier so continue safely as we're likely trying to register it\n // multiple times\n if (local.identifier === id) continue;\n\n this.checkBlockScopedCollisions(local, kind, name, id);\n }\n\n // A redeclaration of an existing variable is a modification\n if (local) {\n this.registerConstantViolation(bindingPath);\n } else {\n this.bindings[name] = new Binding({\n identifier: id,\n scope: this,\n path: bindingPath,\n kind: kind,\n });\n }\n }\n }\n }\n\n addGlobal(node: t.Identifier | t.JSXIdentifier) {\n this.globals[node.name] = node;\n }\n\n hasUid(name: string): boolean {\n let scope: Scope = this;\n\n do {\n if (scope.uids[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasGlobal(name: string): boolean {\n let scope: Scope = this;\n\n do {\n if (scope.globals[name]) return true;\n } while ((scope = scope.parent));\n\n return false;\n }\n\n hasReference(name: string): boolean {\n return !!this.getProgramParent().references[name];\n }\n\n isPure(node: t.Node, constantsOnly?: boolean): boolean {\n if (isIdentifier(node)) {\n const binding = this.getBinding(node.name);\n if (!binding) return false;\n if (constantsOnly) return binding.constant;\n return true;\n } else if (\n isThisExpression(node) ||\n isMetaProperty(node) ||\n isTopicReference(node) ||\n isPrivateName(node)\n ) {\n return true;\n } else if (isClass(node)) {\n if (node.superClass && !this.isPure(node.superClass, constantsOnly)) {\n return false;\n }\n if (node.decorators?.length > 0) {\n return false;\n }\n return this.isPure(node.body, constantsOnly);\n } else if (isClassBody(node)) {\n for (const method of node.body) {\n if (!this.isPure(method, constantsOnly)) return false;\n }\n return true;\n } else if (isBinary(node)) {\n return (\n this.isPure(node.left, constantsOnly) &&\n this.isPure(node.right, constantsOnly)\n );\n } else if (isArrayExpression(node) || isTupleExpression(node)) {\n for (const elem of node.elements) {\n if (elem !== null && !this.isPure(elem, constantsOnly)) return false;\n }\n return true;\n } else if (isObjectExpression(node) || isRecordExpression(node)) {\n for (const prop of node.properties) {\n if (!this.isPure(prop, constantsOnly)) return false;\n }\n return true;\n } else if (isMethod(node)) {\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n if (node.decorators?.length > 0) {\n return false;\n }\n return true;\n } else if (isProperty(node)) {\n // @ts-expect-error todo(flow->ts): computed in not present on private properties\n if (node.computed && !this.isPure(node.key, constantsOnly)) return false;\n if (node.decorators?.length > 0) {\n return false;\n }\n if (isObjectProperty(node) || node.static) {\n if (node.value !== null && !this.isPure(node.value, constantsOnly)) {\n return false;\n }\n }\n return true;\n } else if (isUnaryExpression(node)) {\n return this.isPure(node.argument, constantsOnly);\n } else if (isTaggedTemplateExpression(node)) {\n return (\n matchesPattern(node.tag, \"String.raw\") &&\n !this.hasBinding(\"String\", true) &&\n this.isPure(node.quasi, constantsOnly)\n );\n } else if (isTemplateLiteral(node)) {\n for (const expression of node.expressions) {\n if (!this.isPure(expression, constantsOnly)) return false;\n }\n return true;\n } else {\n return isPureish(node);\n }\n }\n\n /**\n * Set some arbitrary data on the current scope.\n */\n\n setData(key: string | symbol, val: any) {\n return (this.data[key] = val);\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key`.\n */\n\n getData(key: string | symbol): any {\n let scope: Scope = this;\n do {\n const data = scope.data[key];\n if (data != null) return data;\n } while ((scope = scope.parent));\n }\n\n /**\n * Recursively walk up scope tree looking for the data `key` and if it exists,\n * remove it.\n */\n\n removeData(key: string) {\n let scope: Scope = this;\n do {\n const data = scope.data[key];\n if (data != null) scope.data[key] = null;\n } while ((scope = scope.parent));\n }\n\n init() {\n if (!this.inited) {\n this.inited = true;\n this.crawl();\n }\n }\n\n crawl() {\n const path = this.path;\n\n this.references = Object.create(null);\n this.bindings = Object.create(null);\n this.globals = Object.create(null);\n this.uids = Object.create(null);\n this.data = Object.create(null);\n\n const programParent = this.getProgramParent();\n if (programParent.crawling) return;\n\n const state: CollectVisitorState = {\n references: [],\n constantViolations: [],\n assignments: [],\n };\n\n this.crawling = true;\n // traverse does not visit the root node, here we explicitly collect\n // root node binding info when the root is not a Program.\n if (path.type !== \"Program\" && collectorVisitor._exploded) {\n // @ts-expect-error when collectorVisitor is exploded, `enter` always exists\n for (const visit of collectorVisitor.enter) {\n visit(path, state);\n }\n const typeVisitors = collectorVisitor[path.type];\n if (typeVisitors) {\n // @ts-expect-error when collectorVisitor is exploded, `enter` always exists\n for (const visit of typeVisitors.enter) {\n visit(path, state);\n }\n }\n }\n path.traverse(collectorVisitor, state);\n this.crawling = false;\n\n // register assignments\n for (const path of state.assignments) {\n // register undeclared bindings as globals\n const ids = path.getBindingIdentifiers();\n for (const name of Object.keys(ids)) {\n if (path.scope.getBinding(name)) continue;\n programParent.addGlobal(ids[name]);\n }\n\n // register as constant violation\n path.scope.registerConstantViolation(path);\n }\n\n // register references\n for (const ref of state.references) {\n const binding = ref.scope.getBinding(ref.node.name);\n if (binding) {\n binding.reference(ref);\n } else {\n programParent.addGlobal(ref.node);\n }\n }\n\n // register constant violations\n for (const path of state.constantViolations) {\n path.scope.registerConstantViolation(path);\n }\n }\n\n push(opts: {\n id: t.LVal;\n init?: t.Expression;\n unique?: boolean;\n _blockHoist?: number | undefined;\n kind?: \"var\" | \"let\" | \"const\";\n }) {\n let path = this.path;\n\n if (path.isPattern()) {\n path = this.getPatternParent().path;\n } else if (!path.isBlockStatement() && !path.isProgram()) {\n path = this.getBlockParent().path;\n }\n\n if (path.isSwitchStatement()) {\n path = (this.getFunctionParent() || this.getProgramParent()).path;\n }\n\n if (path.isLoop() || path.isCatchClause() || path.isFunction()) {\n // @ts-expect-error TS can not infer NodePath<Loop> | NodePath<CatchClause> as NodePath<Loop | CatchClause>\n path.ensureBlock();\n // @ts-expect-error todo(flow->ts): improve types\n path = path.get(\"body\");\n }\n\n const unique = opts.unique;\n const kind = opts.kind || \"var\";\n const blockHoist = opts._blockHoist == null ? 2 : opts._blockHoist;\n\n const dataKey = `declaration:${kind}:${blockHoist}`;\n let declarPath = !unique && path.getData(dataKey);\n\n if (!declarPath) {\n const declar = variableDeclaration(kind, []);\n // @ts-expect-error todo(flow->ts): avoid modifying nodes\n declar._blockHoist = blockHoist;\n\n [declarPath] = (path as NodePath<t.BlockStatement>).unshiftContainer(\n \"body\",\n [declar],\n );\n if (!unique) path.setData(dataKey, declarPath);\n }\n\n const declarator = variableDeclarator(opts.id, opts.init);\n const len = declarPath.node.declarations.push(declarator);\n path.scope.registerBinding(kind, declarPath.get(\"declarations\")[len - 1]);\n }\n\n /**\n * Walk up to the top of the scope tree and get the `Program`.\n */\n\n getProgramParent() {\n let scope: Scope = this;\n do {\n if (scope.path.isProgram()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\"Couldn't find a Program\");\n }\n\n /**\n * Walk up the scope tree until we hit either a Function or return null.\n */\n\n getFunctionParent(): Scope | null {\n let scope: Scope = this;\n do {\n if (scope.path.isFunctionParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n return null;\n }\n\n /**\n * Walk up the scope tree until we hit either a BlockStatement/Loop/Program/Function/Switch or reach the\n * very top and hit Program.\n */\n\n getBlockParent() {\n let scope: Scope = this;\n do {\n if (scope.path.isBlockParent()) {\n return scope;\n }\n } while ((scope = scope.parent));\n throw new Error(\n \"We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...\",\n );\n }\n\n /**\n * Walk up from a pattern scope (function param initializer) until we hit a non-pattern scope,\n * then returns its block parent\n * @returns An ancestry scope whose path is a block parent\n */\n getPatternParent() {\n let scope: Scope = this;\n do {\n if (!scope.path.isPattern()) {\n return scope.getBlockParent();\n }\n } while ((scope = scope.parent.parent));\n throw new Error(\n \"We couldn't find a BlockStatement, For, Switch, Function, Loop or Program...\",\n );\n }\n\n /**\n * Walks the scope tree and gathers **all** bindings.\n */\n\n getAllBindings(): Record<string, Binding> {\n const ids = Object.create(null);\n\n let scope: Scope = this;\n do {\n for (const key of Object.keys(scope.bindings)) {\n if (key in ids === false) {\n ids[key] = scope.bindings[key];\n }\n }\n scope = scope.parent;\n } while (scope);\n\n return ids;\n }\n\n /**\n * Walks the scope tree and gathers all declarations of `kind`.\n */\n\n getAllBindingsOfKind(...kinds: string[]): Record<string, Binding> {\n const ids = Object.create(null);\n\n for (const kind of kinds) {\n let scope: Scope = this;\n do {\n for (const name of Object.keys(scope.bindings)) {\n const binding = scope.bindings[name];\n if (binding.kind === kind) ids[name] = binding;\n }\n scope = scope.parent;\n } while (scope);\n }\n\n return ids;\n }\n\n bindingIdentifierEquals(name: string, node: t.Node): boolean {\n return this.getBindingIdentifier(name) === node;\n }\n\n getBinding(name: string): Binding | undefined {\n let scope: Scope = this;\n let previousPath;\n\n do {\n const binding = scope.getOwnBinding(name);\n if (binding) {\n // Check if a pattern is a part of parameter expressions.\n // Note: for performance reason we skip checking previousPath.parentPath.isFunction()\n // because `scope.path` is validated as scope in packages/babel-types/src/validators/isScope.js\n // That is, if a scope path is pattern, its parent must be Function/CatchClause\n\n // Spec 9.2.10.28: The closure created by this expression should not have visibility of\n // declarations in the function body. If the binding is not a `param`-kind (as function parameters)\n // or `local`-kind (as id in function expression),\n // then it must be defined inside the function body, thus it should be skipped\n if (\n previousPath?.isPattern() &&\n binding.kind !== \"param\" &&\n binding.kind !== \"local\"\n ) {\n // do nothing\n } else {\n return binding;\n }\n } else if (\n !binding &&\n name === \"arguments\" &&\n scope.path.isFunction() &&\n !scope.path.isArrowFunctionExpression()\n ) {\n break;\n }\n previousPath = scope.path;\n } while ((scope = scope.parent));\n }\n\n getOwnBinding(name: string): Binding | undefined {\n return this.bindings[name];\n }\n\n // todo: return probably can be undefined…\n getBindingIdentifier(name: string): t.Identifier {\n return this.getBinding(name)?.identifier;\n }\n\n // todo: flow->ts return probably can be undefined\n getOwnBindingIdentifier(name: string): t.Identifier {\n const binding = this.bindings[name];\n return binding?.identifier;\n }\n\n hasOwnBinding(name: string) {\n return !!this.getOwnBinding(name);\n }\n\n hasBinding(name: string, noGlobals?: boolean) {\n if (!name) return false;\n if (this.hasOwnBinding(name)) return true;\n if (this.parentHasBinding(name, noGlobals)) return true;\n if (this.hasUid(name)) return true;\n if (!noGlobals && Scope.globals.includes(name)) return true;\n if (!noGlobals && Scope.contextVariables.includes(name)) return true;\n return false;\n }\n\n parentHasBinding(name: string, noGlobals?: boolean) {\n return this.parent?.hasBinding(name, noGlobals);\n }\n\n /**\n * Move a binding of `name` to another `scope`.\n */\n\n moveBindingTo(name: string, scope: Scope) {\n const info = this.getBinding(name);\n if (info) {\n info.scope.removeOwnBinding(name);\n info.scope = scope;\n scope.bindings[name] = info;\n }\n }\n\n removeOwnBinding(name: string) {\n delete this.bindings[name];\n }\n\n removeBinding(name: string) {\n // clear literal binding\n this.getBinding(name)?.scope.removeOwnBinding(name);\n\n // clear uids with this name - https://github.com/babel/babel/issues/2101\n let scope: Scope = this;\n do {\n if (scope.uids[name]) {\n scope.uids[name] = false;\n }\n } while ((scope = scope.parent));\n }\n}\n"],"mappings":";;;;;;AAAA;AAEA;AAEA;AAEA;AACA;AA+CA;AAA+C;EA9C7CA,iBAAiB;EACjBC,cAAc;EACdC,SAAS;EACTC,qBAAqB;EACrBC,UAAU;EACVC,iBAAiB;EACjBC,QAAQ;EACRC,OAAO;EACPC,WAAW;EACXC,kBAAkB;EAClBC,sBAAsB;EACtBC,0BAA0B;EAC1BC,wBAAwB;EACxBC,qBAAqB;EACrBC,YAAY;EACZC,mBAAmB;EACnBC,SAAS;EACTC,QAAQ;EACRC,mBAAmB;EACnBC,iBAAiB;EACjBC,aAAa;EACbC,kBAAkB;EAClBC,UAAU;EACVC,SAAS;EACTC,eAAe;EACfC,OAAO;EACPC,0BAA0B;EAC1BC,iBAAiB;EACjBC,gBAAgB;EAChBC,iBAAiB;EACjBC,qBAAqB;EACrBC,cAAc;EACdC,gBAAgB;EAChBC,cAAc;EACdC,YAAY;EACZC,eAAe;EACfC,mBAAmB;EACnBC,kBAAkB;EAClBC,kBAAkB;EAClBC,iBAAiB;EACjBC,gBAAgB;EAChBC,gBAAgB;EAChBC,cAAc;EACdC;AAAa;AAQf,SAASC,eAAe,CAACC,IAAY,EAAEC,KAAiB,EAAE;EACxD,QAAQD,IAAI,oBAAJA,IAAI,CAAEE,IAAI;IAChB;MACE,IAAI7B,mB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