1 line
16 KiB
Text
1 line
16 KiB
Text
|
{"version":3,"names":["virtualTypes","require","_debug","_index","_index2","_t","t","cache","_generator","NodePath_ancestry","NodePath_inference","NodePath_replacement","NodePath_evaluation","NodePath_conversion","NodePath_introspection","NodePath_context","NodePath_removal","NodePath_modification","NodePath_family","NodePath_comments","NodePath_virtual_types_validator","validate","debug","buildDebug","REMOVED","exports","SHOULD_STOP","SHOULD_SKIP","NodePath","constructor","hub","parent","contexts","state","opts","_traverseFlags","skipKeys","parentPath","container","listKey","key","node","type","data","context","scope","get","Error","targetNode","paths","getOrCreateCachedPaths","path","set","setup","getScope","isScope","Scope","setData","val","Object","create","getData","def","undefined","hasNode","buildCodeFrameError","msg","SyntaxError","buildError","traverse","visitor","getPathLocation","parts","inList","unshift","join","message","enabled","toString","generator","code","parentKey","shouldSkip","v","shouldStop","removed","assign","prototype","_guessExecutionStatusRelativeToDifferentFunctions","_guessExecutionStatusRelativeTo","TYPES","typeKey","fn","TypeError","keys","includes","push","_default","default"],"sources":["../../src/path/index.ts"],"sourcesContent":["import type { HubInterface } from \"../hub.ts\";\nimport type TraversalContext from \"../context.ts\";\nimport type { ExplodedTraverseOptions } from \"../index.ts\";\nimport * as virtualTypes from \"./lib/virtual-types.ts\";\nimport buildDebug from \"debug\";\nimport traverse from \"../index.ts\";\nimport type { Visitor } from \"../types.ts\";\nimport Scope from \"../scope/index.ts\";\nimport { validate } from \"@babel/types\";\nimport * as t from \"@babel/types\";\nimport * as cache from \"../cache.ts\";\nimport generator from \"@babel/generator\";\n\n// NodePath is split across many files.\nimport * as NodePath_ancestry from \"./ancestry.ts\";\nimport * as NodePath_inference from \"./inference/index.ts\";\nimport * as NodePath_replacement from \"./replacement.ts\";\nimport * as NodePath_evaluation from \"./evaluation.ts\";\nimport * as NodePath_conversion from \"./conversion.ts\";\nimport * as NodePath_introspection from \"./introspection.ts\";\nimport * as NodePath_context from \"./context.ts\";\nimport * as NodePath_removal from \"./removal.ts\";\nimport * as NodePath_modification from \"./modification.ts\";\nimport * as NodePath_family from \"./family.ts\";\nimport * as NodePath_comments from \"./comments.ts\";\nimport * as NodePath_virtual_types_validator from \"./lib/virtual-types-validator.ts\";\nimport type { NodePathAssertions } from \"./generated/asserts.ts\";\nimport type { NodePathValidators } from \"./generated/validators.ts\";\n\nconst debug = buildDebug(\"babel\");\n\nexport const REMOVED = 1 << 0;\nexport const SHOULD_STOP = 1 << 1;\nexport const SHOULD_SKIP = 1 << 2;\n\nclass NodePath<T extends t.Node = t.Node> {\n constructor(hub: HubInterface, parent: t.ParentMaps[T[\"type\"]]) {\n this.parent = parent;\n this.hub = hub;\n this.data = null;\n\n this.context = null;\n this.scope = null;\n }\n\n declare parent: t.ParentMaps[T[\"type\"]];\n declare hub: HubInterface;\n declare data: Record<string | symbol, unknown>;\n // TraversalContext is configured by setContext\n declare context: TraversalContext;\n declare scope: Scope;\n\n contexts: Array<TraversalContext> = [];\n state: any = null;\n opts: ExplodedTraverseOptions | null = null;\n // this.shouldSkip = false; this.shouldStop = false; this.removed = false;\n _traverseFlags: number = 0;\n skipKeys: Record<string, boolean> | null = null;\n parentPath: t.ParentMaps[T[\"type\"]] extends null\n ? null\n : NodePath<t.ParentMaps[T[\"type\"]]> | null = null;\n container: t.Node | Array<t.Node> | null = null;\n listKey: string | null = null;\n key: string | number | null = null;\n node: T = null;\n type: T[\"type\"] | null = null;\n\n static get({\n hub,\n parentPath,\n parent,\n container,\n listKey,\n key,\n }: {\n hub?: HubInterface
|