diff --git a/lib/tsserver.js b/lib/tsserver.js index 3164337a5d..f63a607bf6 100644 --- a/lib/tsserver.js +++ b/lib/tsserver.js @@ -198426,7 +198426,7 @@ var ts; var _this = this; var callback = function (node) { // Namespace import will introduce closure in the es2abc compiler stage - if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node, faultId)) { + if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node)) { return; } // The "b" of "A.b" should not be checked since it's load from object "A" @@ -198502,13 +198502,13 @@ var ts; } return false; }; - TypeScriptLinter.prototype.checkNamespaceImportVar = function (node, faultId) { + TypeScriptLinter.prototype.checkNamespaceImportVar = function (node) { // Namespace import cannot be determined by the true symbol var sym = TypeScriptLinter.tsTypeChecker.getSymbolAtLocation(node); var decls = sym === null || sym === void 0 ? void 0 : sym.getDeclarations(); if (decls === null || decls === void 0 ? void 0 : decls.length) { if (ts.isNamespaceImport(decls[0])) { - this.incrementCounters(node, faultId); + this.incrementCounters(node, FaultID.SendableCapturedVars); return true; } } diff --git a/lib/tsserverlibrary.js b/lib/tsserverlibrary.js index af846c08be..e7eb7c6b31 100644 --- a/lib/tsserverlibrary.js +++ b/lib/tsserverlibrary.js @@ -198171,7 +198171,7 @@ var ts; var _this = this; var callback = function (node) { // Namespace import will introduce closure in the es2abc compiler stage - if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node, faultId)) { + if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node)) { return; } // The "b" of "A.b" should not be checked since it's load from object "A" @@ -198247,13 +198247,13 @@ var ts; } return false; }; - TypeScriptLinter.prototype.checkNamespaceImportVar = function (node, faultId) { + TypeScriptLinter.prototype.checkNamespaceImportVar = function (node) { // Namespace import cannot be determined by the true symbol var sym = TypeScriptLinter.tsTypeChecker.getSymbolAtLocation(node); var decls = sym === null || sym === void 0 ? void 0 : sym.getDeclarations(); if (decls === null || decls === void 0 ? void 0 : decls.length) { if (ts.isNamespaceImport(decls[0])) { - this.incrementCounters(node, faultId); + this.incrementCounters(node, FaultID.SendableCapturedVars); return true; } } diff --git a/lib/typescript.js b/lib/typescript.js index 7f24570e01..e62d151de3 100644 --- a/lib/typescript.js +++ b/lib/typescript.js @@ -187265,7 +187265,7 @@ var ts; var _this = this; var callback = function (node) { // Namespace import will introduce closure in the es2abc compiler stage - if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node, faultId)) { + if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node)) { return; } // The "b" of "A.b" should not be checked since it's load from object "A" @@ -187341,13 +187341,13 @@ var ts; } return false; }; - TypeScriptLinter.prototype.checkNamespaceImportVar = function (node, faultId) { + TypeScriptLinter.prototype.checkNamespaceImportVar = function (node) { // Namespace import cannot be determined by the true symbol var sym = TypeScriptLinter.tsTypeChecker.getSymbolAtLocation(node); var decls = sym === null || sym === void 0 ? void 0 : sym.getDeclarations(); if (decls === null || decls === void 0 ? void 0 : decls.length) { if (ts.isNamespaceImport(decls[0])) { - this.incrementCounters(node, faultId); + this.incrementCounters(node, FaultID.SendableCapturedVars); return true; } } diff --git a/lib/typescriptServices.js b/lib/typescriptServices.js index 043c076f3d..9e15503965 100644 --- a/lib/typescriptServices.js +++ b/lib/typescriptServices.js @@ -187265,7 +187265,7 @@ var ts; var _this = this; var callback = function (node) { // Namespace import will introduce closure in the es2abc compiler stage - if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node, faultId)) { + if (!ts.isIdentifier(node) || _this.checkNamespaceImportVar(node)) { return; } // The "b" of "A.b" should not be checked since it's load from object "A" @@ -187341,13 +187341,13 @@ var ts; } return false; }; - TypeScriptLinter.prototype.checkNamespaceImportVar = function (node, faultId) { + TypeScriptLinter.prototype.checkNamespaceImportVar = function (node) { // Namespace import cannot be determined by the true symbol var sym = TypeScriptLinter.tsTypeChecker.getSymbolAtLocation(node); var decls = sym === null || sym === void 0 ? void 0 : sym.getDeclarations(); if (decls === null || decls === void 0 ? void 0 : decls.length) { if (ts.isNamespaceImport(decls[0])) { - this.incrementCounters(node, faultId); + this.incrementCounters(node, FaultID.SendableCapturedVars); return true; } } diff --git a/src/linter/ArkTSLinter_1_1/LinterRunner.ts b/src/linter/ArkTSLinter_1_1/LinterRunner.ts index 3749446050..1010a400a8 100644 --- a/src/linter/ArkTSLinter_1_1/LinterRunner.ts +++ b/src/linter/ArkTSLinter_1_1/LinterRunner.ts @@ -47,7 +47,12 @@ export function runArkTSLinter(tsBuilderProgram: BuilderProgram, srcFile?: Sourc const tscDiagnosticsLinter = new TSCCompiledProgram(tsBuilderProgram); const program = tscDiagnosticsLinter.getProgram(); const compilerOptions = program.getCompilerOptions(); - const changedFiles = collectChangedFilesFromProgramState(programState, arkTSVersion, compilerOptions.compatibleSdkVersion, compilerOptions.compatibleSdkVersionStage); + const changedFiles = collectChangedFilesFromProgramState( + programState, + arkTSVersion, + compilerOptions.compatibleSdkVersion, + compilerOptions.compatibleSdkVersionStage + ); // Set arkTSVersion info for file .tsbuildinfo. // File .tsbuildinfo.linter dosen't need to set arkTSVersion because it dosen't contain linter diagnostics. programState.arkTSVersion = arkTSVersion; diff --git a/src/linter/ArkTSLinter_1_1/TypeScriptLinter.ts b/src/linter/ArkTSLinter_1_1/TypeScriptLinter.ts index 1164561633..f40f936861 100644 --- a/src/linter/ArkTSLinter_1_1/TypeScriptLinter.ts +++ b/src/linter/ArkTSLinter_1_1/TypeScriptLinter.ts @@ -1307,7 +1307,7 @@ export class TypeScriptLinter { private scanCapturedVarsInSendableScope(startNode: ts.Node, scope: ts.Node, faultId: FaultID): void { const callback = (node: ts.Node): void => { // Namespace import will introduce closure in the es2abc compiler stage - if (!ts.isIdentifier(node) || this.checkNamespaceImportVar(node, faultId)) { + if (!ts.isIdentifier(node) || this.checkNamespaceImportVar(node)) { return; } @@ -1397,13 +1397,13 @@ export class TypeScriptLinter { return false; } - private checkNamespaceImportVar(node: ts.Node, faultId: FaultID): boolean { + private checkNamespaceImportVar(node: ts.Node): boolean { // Namespace import cannot be determined by the true symbol const sym = TypeScriptLinter.tsTypeChecker.getSymbolAtLocation(node); const decls = sym?.getDeclarations(); if (decls?.length) { if (ts.isNamespaceImport(decls[0])) { - this.incrementCounters(node, faultId); + this.incrementCounters(node, FaultID.SendableCapturedVars); return true; } }