毕设专用git仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
20 KiB

{"version":3,"names":["Definition","PatternVisitor","OriginalPatternVisitor","Referencer","OriginalReferencer","Scope","ScopeManager","require","getKeys","fallback","visitorKeysMap","getVisitorValues","nodeType","client","FLOW_FLIPPED_ALIAS_KEYS","VISITOR_KEYS","getTypesInfo","flowFlippedAliasKeys","concat","Object","entries","reduce","acc","key","value","includes","propertyTypes","callProperties","type","values","indexers","properties","types","params","argument","elementType","qualification","rest","returnType","typeAnnotation","typeParameters","id","ArrayPattern","node","elements","forEach","visit","ObjectPattern","_client","WeakMap","constructor","options","scopeManager","_classPrivateFieldInitSpec","writable","_classPrivateFieldSet","visitPattern","callback","_checkIdentifierOrVisit","left","processRightHandNodes","visitor","rightHandNodes","visitClass","_visitArray","decorators","typeParamScope","_nestTypeParamScope","_visitTypeAnnotation","implements","superTypeParameters","close","visitFunction","visitProperty","_node$value","InterfaceDeclaration","_createScopeVariable","extends","body","TypeAlias","right","ClassProperty","_visitClassProperty","ClassPrivateProperty","PropertyDefinition","ClassPrivateMethod","MethodDefinition","DeclareModule","_visitDeclareX","DeclareFunction","DeclareVariable","DeclareClass","OptionalMemberExpression","MemberExpression","name","currentScope","variableScope","__define","parentScope","__currentScope","scope","__nestScope","j","length","apply","arguments","Array","isArray","visitorValues","_classPrivateFieldGet","i","visitorValue","propertyType","nodeProperty","k","loopPropertyNode","l","nodeList","module","exports","analyzeScope","ast","parserOptions","_parserOptions$ecmaFe","ignoreEval","optimistic","directive","nodejsScope","sourceType","ecmaFeatures","globalReturn","impliedStrict","ecmaVersion","childVisitorKeys","getVisitorKeys","referencer"],"sources":["../src/analyze-scope.cjs"],"sourcesContent":["const {\n Definition,\n PatternVisitor: OriginalPatternVisitor,\n Referencer: OriginalReferencer,\n Scope,\n ScopeManager,\n} = process.env.BABEL_8_BREAKING\n ? require(\"eslint-scope\")\n : require(\"@nicolo-ribaudo/eslint-scope-5-internals\");\nconst { getKeys: fallback } = require(\"eslint-visitor-keys\");\n\nlet visitorKeysMap;\nfunction getVisitorValues(nodeType, client) {\n if (visitorKeysMap) return visitorKeysMap[nodeType];\n\n const { FLOW_FLIPPED_ALIAS_KEYS, VISITOR_KEYS } = client.getTypesInfo();\n\n const flowFlippedAliasKeys = FLOW_FLIPPED_ALIAS_KEYS.concat([\n \"ArrayPattern\",\n \"ClassDeclaration\",\n \"ClassExpression\",\n \"FunctionDeclaration\",\n \"FunctionExpression\",\n \"Identifier\",\n \"ObjectPattern\",\n \"RestElement\",\n ]);\n\n visitorKeysMap = Object.entries(VISITOR_KEYS).reduce((acc, [key, value]) => {\n if (!flowFlippedAliasKeys.includes(value)) {\n acc[key] = value;\n }\n return acc;\n }, {});\n\n return visitorKeysMap[nodeType];\n}\n\nconst propertyTypes = {\n // loops\n callProperties: { type: \"loop\", values: [\"value\"] },\n indexers: { type: \"loop\", values: [\"key\", \"value\"] },\n properties: { type: \"loop\", values: [\"argument\", \"value\"] },\n types: { type: \"loop\" },\n params: { type: \"loop\" },\n // single property\n argument: { type: \"single\" },\n elementType: { type: \"single\" },\n qualification: { type: \"single\" },\n rest: { type: \"single\" },\n returnType: { type: \"single\" },\n // others\n typeAnnotation: { type: \"typeAnnotation\" },\n typeParameters: { type: \"typeParameters\" },\n id: { type: \"id\" },\n};\n\nclass PatternVisitor extends OriginalPatternVisitor {\n ArrayPattern(node) {\n node.elements.forEach(this.visit, this);\n }\n\n ObjectPattern(node) {\n node.properties.forEach(this.visit, this);\n }\n}\n\nclass Referencer extends OriginalReferencer {\n #client;\n\n constructor(options, scopeManager, client) {\n super(options, scopeManager);\n this.#client = client;\n }\n\n // inherits.\n visitPattern(node, options, callbac