Explorar o código

Support for class static blocks

sanex %!s(int64=3) %!d(string=hai) anos
pai
achega
ac3c34fe77
Modificáronse 3 ficheiros con 234 adicións e 459 borrados
  1. 26 24
      package.json
  2. 5 1
      src/analyzers/scope-analyzer/ScopeAnalyzer.ts
  3. 203 434
      yarn.lock

+ 26 - 24
package.json

@@ -22,15 +22,16 @@
   "types": "typings/index.d.ts",
   "dependencies": {
     "@javascript-obfuscator/escodegen": "2.2.2",
-    "@javascript-obfuscator/estraverse": "5.3.0",
+    "@javascript-obfuscator/estraverse": "5.4.0",
     "@nuxtjs/opencollective": "0.3.2",
-    "acorn": "8.5.0",
+    "acorn": "8.7.0",
     "assert": "2.0.0",
     "chalk": "4.1.2",
     "chance": "1.1.8",
     "class-validator": "0.13.2",
-    "commander": "8.3.0",
-    "eslint-scope": "6.0.0",
+    "commander": "9.0.0",
+    "eslint-scope": "7.1.0",
+    "eslint-visitor-keys": "3.2.0",
     "fast-deep-equal": "3.1.3",
     "inversify": "6.0.1",
     "js-string-escape": "1.0.1",
@@ -39,58 +40,59 @@
     "multimatch": "5.0.0",
     "process": "0.11.10",
     "reflect-metadata": "0.1.13",
-    "source-map-support": "0.5.20",
+    "source-map-support": "0.5.21",
     "string-template": "1.0.0",
     "stringz": "2.1.0",
     "tslib": "2.3.1"
   },
   "devDependencies": {
-    "@istanbuljs/nyc-config-typescript": "1.0.1",
-    "@types/chai": "4.2.22",
+    "@istanbuljs/nyc-config-typescript": "1.0.2",
+    "@types/chai": "4.3.0",
     "@types/chance": "1.1.3",
     "@types/escodegen": "0.0.7",
-    "@types/eslint-scope": "3.7.1",
+    "@types/eslint-scope": "3.7.3",
+    "@types/eslint-visitor-keys": "1.0.0",
     "@types/estraverse": "5.1.1",
     "@types/estree": "0.0.50",
     "@types/js-beautify": "1.13.3",
     "@types/js-string-escape": "1.0.1",
     "@types/md5": "2.3.1",
     "@types/mkdirp": "1.0.2",
-    "@types/mocha": "9.0.0",
+    "@types/mocha": "9.1.0",
     "@types/multimatch": "4.0.0",
-    "@types/node": "16.11.6",
+    "@types/node": "17.0.13",
     "@types/rimraf": "3.0.2",
-    "@types/sinon": "10.0.6",
+    "@types/sinon": "10.0.9",
     "@types/string-template": "1.0.2",
     "@types/webpack-env": "1.16.3",
-    "@typescript-eslint/eslint-plugin": "5.2.0",
-    "@typescript-eslint/parser": "5.2.0",
-    "chai": "4.3.4",
+    "@typescript-eslint/eslint-plugin": "5.10.1",
+    "@typescript-eslint/parser": "5.10.1",
+    "chai": "4.3.6",
     "chai-exclude": "2.1.0",
     "cross-env": "7.0.3",
-    "eslint": "8.1.0",
-    "eslint-plugin-import": "2.25.2",
-    "eslint-plugin-jsdoc": "37.0.3",
+    "eslint": "8.8.0",
+    "eslint-plugin-import": "2.25.4",
+    "eslint-plugin-jsdoc": "37.7.0",
     "eslint-plugin-no-null": "1.0.2",
     "eslint-plugin-prefer-arrow": "1.2.3",
-    "eslint-plugin-unicorn": "37.0.1",
+    "eslint-plugin-unicorn": "40.1.0",
     "fork-ts-checker-notifier-webpack-plugin": "4.0.0",
     "fork-ts-checker-webpack-plugin": "6.4.0",
     "husky": "7.0.4",
     "js-beautify": "1.14.0",
-    "mocha": "9.1.3",
+    "mocha": "9.2.0",
     "nyc": "15.1.0",
     "pjson": "1.0.9",
     "rimraf": "3.0.2",
-    "sinon": "11.1.2",
+    "sinon": "13.0.0",
     "source-map-resolve": "0.6.0",
-    "terser": "5.9.0",
+    "terser": "5.10.0",
     "threads": "1.7.0",
     "ts-loader": "9.2.6",
     "ts-node": "10.4.0",
-    "typescript": "4.4.4",
-    "webpack": "5.61.0",
-    "webpack-cli": "4.9.1",
+    "typescript": "4.5.5",
+    "webpack": "5.67.0",
+    "webpack-cli": "4.9.2",
     "webpack-node-externals": "3.0.0"
   },
   "repository": {

+ 5 - 1
src/analyzers/scope-analyzer/ScopeAnalyzer.ts

@@ -2,6 +2,7 @@ import { injectable, } from 'inversify';
 
 import * as eslintScope from 'eslint-scope';
 import * as estraverse from '@javascript-obfuscator/estraverse';
+import { KEYS, VisitorKeys } from 'eslint-visitor-keys';
 import * as ESTree from 'estree';
 
 import { IScopeAnalyzer } from '../../interfaces/analyzers/scope-analyzer/IScopeAnalyzer';
@@ -15,8 +16,11 @@ export class ScopeAnalyzer implements IScopeAnalyzer {
     /**
      * @type {eslintScope.AnalysisOptions}
      */
-    private static readonly eslintScopeOptions: eslintScope.AnalysisOptions = {
+    private static readonly eslintScopeOptions: eslintScope.AnalysisOptions & {
+        childVisitorKeys: VisitorKeys;
+    } = {
         ecmaVersion,
+        childVisitorKeys: KEYS,
         optimistic: true
     };
 

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 203 - 434
yarn.lock


Algúns arquivos non se mostraron porque demasiados arquivos cambiaron neste cambio