Remove import lazy

Issue: https://gitee.com/openharmony/third_party_typescript/issues/IAK8VW
Signed-off-by: azwenqiang <dengwenqiang5@huawei.com>
Change-Id: I4f9330dbeb6c969a44c8380e16451a92880254d7
This commit is contained in:
azwenqiang 2024-08-15 14:44:15 +08:00
parent 347b48503a
commit a78cedb97b
15 changed files with 15 additions and 128 deletions

View File

@ -194220,7 +194220,7 @@ var ts;
(function (ArkTSLinter_1_1) {
ArkTSLinter_1_1.cookBookMsg = [];
ArkTSLinter_1_1.cookBookTag = [];
for (var i = 0; i <= 183; i++) {
for (var i = 0; i <= 182; i++) {
ArkTSLinter_1_1.cookBookMsg[i] = "";
}
ArkTSLinter_1_1.cookBookTag[1] = "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)";
@ -194408,8 +194408,6 @@ var ts;
'The exported "Sendable" class or function cannot be captured by "Sendable" class or function in current file (arkts-sendable-closure-export)';
ArkTSLinter_1_1.cookBookTag[182] =
'Sendable functions and sendable typealias are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-sendable-beta-compatible)';
ArkTSLinter_1_1.cookBookTag[183] =
'Lazy imports are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-import-lazy-beta-compatible)';
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
/*
@ -194689,8 +194687,7 @@ var ts;
FaultID[FaultID["SendableClosureExport"] = 108] = "SendableClosureExport";
FaultID[FaultID["SharedModuleExportsWarning"] = 109] = "SharedModuleExportsWarning";
FaultID[FaultID["SendableBetaCompatible"] = 110] = "SendableBetaCompatible";
FaultID[FaultID["ImportLazyBetaCompatible"] = 111] = "ImportLazyBetaCompatible";
FaultID[FaultID["LAST_ID"] = 112] = "LAST_ID";
FaultID[FaultID["LAST_ID"] = 111] = "LAST_ID";
})(FaultID = Problems.FaultID || (Problems.FaultID = {}));
var FaultAttributes = /** @class */ (function () {
function FaultAttributes(cookBookRef, migratable, severity) {
@ -194815,7 +194812,6 @@ var ts;
Problems.faultsAttrs[FaultID.SendableClosureExport] = new FaultAttributes(181, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SharedModuleExportsWarning] = new FaultAttributes(163, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SendableBetaCompatible] = new FaultAttributes(182);
Problems.faultsAttrs[FaultID.ImportLazyBetaCompatible] = new FaultAttributes(183);
})(Problems = ArkTSLinter_1_1.Problems || (ArkTSLinter_1_1.Problems = {}));
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
@ -198661,7 +198657,6 @@ var ts;
if (tsImportClause.name) {
this.countDeclarationsWithDuplicateName(tsImportClause.name, tsImportClause);
}
this.checkImportLazy(tsImportClause);
};
TypeScriptLinter.prototype.handleImportSpecifier = function (node) {
var tsImportSpecifier = node;
@ -199545,14 +199540,6 @@ var ts;
}
return false;
};
TypeScriptLinter.prototype.checkImportLazy = function (tsImportClause) {
if (!tsImportClause.isLazy ||
this.compatibleSdkVersion > 12 ||
this.compatibleSdkVersion === 12 && (this.compatibleSdkVersionStage !== 'beta1' && this.compatibleSdkVersionStage !== 'beta2')) {
return;
}
this.incrementCounters(tsImportClause, FaultID.ImportLazyBetaCompatible);
};
TypeScriptLinter.reportDiagnostics = true;
// The SyntaxKind enum defines additional elements at the end of the enum
// that serve as markers (FirstX/LastX). Those elements are initialized

View File

@ -13224,8 +13224,7 @@ declare namespace ts {
SendableClosureExport = 108,
SharedModuleExportsWarning = 109,
SendableBetaCompatible = 110,
ImportLazyBetaCompatible = 111,
LAST_ID = 112
LAST_ID = 111
}
class FaultAttributes {
cookBookRef: number;
@ -13652,7 +13651,6 @@ declare namespace ts {
private checkAssignmentMatching;
private handleDecorator;
private isSendableDecoratorValid;
private checkImportLazy;
}
}
}

View File

@ -193965,7 +193965,7 @@ var ts;
(function (ArkTSLinter_1_1) {
ArkTSLinter_1_1.cookBookMsg = [];
ArkTSLinter_1_1.cookBookTag = [];
for (var i = 0; i <= 183; i++) {
for (var i = 0; i <= 182; i++) {
ArkTSLinter_1_1.cookBookMsg[i] = "";
}
ArkTSLinter_1_1.cookBookTag[1] = "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)";
@ -194153,8 +194153,6 @@ var ts;
'The exported "Sendable" class or function cannot be captured by "Sendable" class or function in current file (arkts-sendable-closure-export)';
ArkTSLinter_1_1.cookBookTag[182] =
'Sendable functions and sendable typealias are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-sendable-beta-compatible)';
ArkTSLinter_1_1.cookBookTag[183] =
'Lazy imports are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-import-lazy-beta-compatible)';
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
/*
@ -194434,8 +194432,7 @@ var ts;
FaultID[FaultID["SendableClosureExport"] = 108] = "SendableClosureExport";
FaultID[FaultID["SharedModuleExportsWarning"] = 109] = "SharedModuleExportsWarning";
FaultID[FaultID["SendableBetaCompatible"] = 110] = "SendableBetaCompatible";
FaultID[FaultID["ImportLazyBetaCompatible"] = 111] = "ImportLazyBetaCompatible";
FaultID[FaultID["LAST_ID"] = 112] = "LAST_ID";
FaultID[FaultID["LAST_ID"] = 111] = "LAST_ID";
})(FaultID = Problems.FaultID || (Problems.FaultID = {}));
var FaultAttributes = /** @class */ (function () {
function FaultAttributes(cookBookRef, migratable, severity) {
@ -194560,7 +194557,6 @@ var ts;
Problems.faultsAttrs[FaultID.SendableClosureExport] = new FaultAttributes(181, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SharedModuleExportsWarning] = new FaultAttributes(163, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SendableBetaCompatible] = new FaultAttributes(182);
Problems.faultsAttrs[FaultID.ImportLazyBetaCompatible] = new FaultAttributes(183);
})(Problems = ArkTSLinter_1_1.Problems || (ArkTSLinter_1_1.Problems = {}));
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
@ -198406,7 +198402,6 @@ var ts;
if (tsImportClause.name) {
this.countDeclarationsWithDuplicateName(tsImportClause.name, tsImportClause);
}
this.checkImportLazy(tsImportClause);
};
TypeScriptLinter.prototype.handleImportSpecifier = function (node) {
var tsImportSpecifier = node;
@ -199290,14 +199285,6 @@ var ts;
}
return false;
};
TypeScriptLinter.prototype.checkImportLazy = function (tsImportClause) {
if (!tsImportClause.isLazy ||
this.compatibleSdkVersion > 12 ||
this.compatibleSdkVersion === 12 && (this.compatibleSdkVersionStage !== 'beta1' && this.compatibleSdkVersionStage !== 'beta2')) {
return;
}
this.incrementCounters(tsImportClause, FaultID.ImportLazyBetaCompatible);
};
TypeScriptLinter.reportDiagnostics = true;
// The SyntaxKind enum defines additional elements at the end of the enum
// that serve as markers (FirstX/LastX). Those elements are initialized

4
lib/typescript.d.ts vendored
View File

@ -9278,8 +9278,7 @@ declare namespace ts {
SendableClosureExport = 108,
SharedModuleExportsWarning = 109,
SendableBetaCompatible = 110,
ImportLazyBetaCompatible = 111,
LAST_ID = 112
LAST_ID = 111
}
class FaultAttributes {
cookBookRef: number;
@ -9706,7 +9705,6 @@ declare namespace ts {
private checkAssignmentMatching;
private handleDecorator;
private isSendableDecoratorValid;
private checkImportLazy;
}
}
}

View File

@ -183059,7 +183059,7 @@ var ts;
(function (ArkTSLinter_1_1) {
ArkTSLinter_1_1.cookBookMsg = [];
ArkTSLinter_1_1.cookBookTag = [];
for (var i = 0; i <= 183; i++) {
for (var i = 0; i <= 182; i++) {
ArkTSLinter_1_1.cookBookMsg[i] = "";
}
ArkTSLinter_1_1.cookBookTag[1] = "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)";
@ -183247,8 +183247,6 @@ var ts;
'The exported "Sendable" class or function cannot be captured by "Sendable" class or function in current file (arkts-sendable-closure-export)';
ArkTSLinter_1_1.cookBookTag[182] =
'Sendable functions and sendable typealias are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-sendable-beta-compatible)';
ArkTSLinter_1_1.cookBookTag[183] =
'Lazy imports are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-import-lazy-beta-compatible)';
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
/*
@ -183528,8 +183526,7 @@ var ts;
FaultID[FaultID["SendableClosureExport"] = 108] = "SendableClosureExport";
FaultID[FaultID["SharedModuleExportsWarning"] = 109] = "SharedModuleExportsWarning";
FaultID[FaultID["SendableBetaCompatible"] = 110] = "SendableBetaCompatible";
FaultID[FaultID["ImportLazyBetaCompatible"] = 111] = "ImportLazyBetaCompatible";
FaultID[FaultID["LAST_ID"] = 112] = "LAST_ID";
FaultID[FaultID["LAST_ID"] = 111] = "LAST_ID";
})(FaultID = Problems.FaultID || (Problems.FaultID = {}));
var FaultAttributes = /** @class */ (function () {
function FaultAttributes(cookBookRef, migratable, severity) {
@ -183654,7 +183651,6 @@ var ts;
Problems.faultsAttrs[FaultID.SendableClosureExport] = new FaultAttributes(181, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SharedModuleExportsWarning] = new FaultAttributes(163, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SendableBetaCompatible] = new FaultAttributes(182);
Problems.faultsAttrs[FaultID.ImportLazyBetaCompatible] = new FaultAttributes(183);
})(Problems = ArkTSLinter_1_1.Problems || (ArkTSLinter_1_1.Problems = {}));
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
@ -187500,7 +187496,6 @@ var ts;
if (tsImportClause.name) {
this.countDeclarationsWithDuplicateName(tsImportClause.name, tsImportClause);
}
this.checkImportLazy(tsImportClause);
};
TypeScriptLinter.prototype.handleImportSpecifier = function (node) {
var tsImportSpecifier = node;
@ -188384,14 +188379,6 @@ var ts;
}
return false;
};
TypeScriptLinter.prototype.checkImportLazy = function (tsImportClause) {
if (!tsImportClause.isLazy ||
this.compatibleSdkVersion > 12 ||
this.compatibleSdkVersion === 12 && (this.compatibleSdkVersionStage !== 'beta1' && this.compatibleSdkVersionStage !== 'beta2')) {
return;
}
this.incrementCounters(tsImportClause, FaultID.ImportLazyBetaCompatible);
};
TypeScriptLinter.reportDiagnostics = true;
// The SyntaxKind enum defines additional elements at the end of the enum
// that serve as markers (FirstX/LastX). Those elements are initialized

View File

@ -9278,8 +9278,7 @@ declare namespace ts {
SendableClosureExport = 108,
SharedModuleExportsWarning = 109,
SendableBetaCompatible = 110,
ImportLazyBetaCompatible = 111,
LAST_ID = 112
LAST_ID = 111
}
class FaultAttributes {
cookBookRef: number;
@ -9706,7 +9705,6 @@ declare namespace ts {
private checkAssignmentMatching;
private handleDecorator;
private isSendableDecoratorValid;
private checkImportLazy;
}
}
}

View File

@ -183059,7 +183059,7 @@ var ts;
(function (ArkTSLinter_1_1) {
ArkTSLinter_1_1.cookBookMsg = [];
ArkTSLinter_1_1.cookBookTag = [];
for (var i = 0; i <= 183; i++) {
for (var i = 0; i <= 182; i++) {
ArkTSLinter_1_1.cookBookMsg[i] = "";
}
ArkTSLinter_1_1.cookBookTag[1] = "Objects with property names that are not identifiers are not supported (arkts-identifiers-as-prop-names)";
@ -183247,8 +183247,6 @@ var ts;
'The exported "Sendable" class or function cannot be captured by "Sendable" class or function in current file (arkts-sendable-closure-export)';
ArkTSLinter_1_1.cookBookTag[182] =
'Sendable functions and sendable typealias are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-sendable-beta-compatible)';
ArkTSLinter_1_1.cookBookTag[183] =
'Lazy imports are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-import-lazy-beta-compatible)';
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
/*
@ -183528,8 +183526,7 @@ var ts;
FaultID[FaultID["SendableClosureExport"] = 108] = "SendableClosureExport";
FaultID[FaultID["SharedModuleExportsWarning"] = 109] = "SharedModuleExportsWarning";
FaultID[FaultID["SendableBetaCompatible"] = 110] = "SendableBetaCompatible";
FaultID[FaultID["ImportLazyBetaCompatible"] = 111] = "ImportLazyBetaCompatible";
FaultID[FaultID["LAST_ID"] = 112] = "LAST_ID";
FaultID[FaultID["LAST_ID"] = 111] = "LAST_ID";
})(FaultID = Problems.FaultID || (Problems.FaultID = {}));
var FaultAttributes = /** @class */ (function () {
function FaultAttributes(cookBookRef, migratable, severity) {
@ -183654,7 +183651,6 @@ var ts;
Problems.faultsAttrs[FaultID.SendableClosureExport] = new FaultAttributes(181, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SharedModuleExportsWarning] = new FaultAttributes(163, false, ProblemSeverity.WARNING);
Problems.faultsAttrs[FaultID.SendableBetaCompatible] = new FaultAttributes(182);
Problems.faultsAttrs[FaultID.ImportLazyBetaCompatible] = new FaultAttributes(183);
})(Problems = ArkTSLinter_1_1.Problems || (ArkTSLinter_1_1.Problems = {}));
})(ArkTSLinter_1_1 = ts.ArkTSLinter_1_1 || (ts.ArkTSLinter_1_1 = {}));
})(ts || (ts = {}));
@ -187500,7 +187496,6 @@ var ts;
if (tsImportClause.name) {
this.countDeclarationsWithDuplicateName(tsImportClause.name, tsImportClause);
}
this.checkImportLazy(tsImportClause);
};
TypeScriptLinter.prototype.handleImportSpecifier = function (node) {
var tsImportSpecifier = node;
@ -188384,14 +188379,6 @@ var ts;
}
return false;
};
TypeScriptLinter.prototype.checkImportLazy = function (tsImportClause) {
if (!tsImportClause.isLazy ||
this.compatibleSdkVersion > 12 ||
this.compatibleSdkVersion === 12 && (this.compatibleSdkVersionStage !== 'beta1' && this.compatibleSdkVersionStage !== 'beta2')) {
return;
}
this.incrementCounters(tsImportClause, FaultID.ImportLazyBetaCompatible);
};
TypeScriptLinter.reportDiagnostics = true;
// The SyntaxKind enum defines additional elements at the end of the enum
// that serve as markers (FirstX/LastX). Those elements are initialized

View File

@ -17,7 +17,7 @@ export namespace ArkTSLinter_1_1 {
export const cookBookMsg: string[] = [];
export const cookBookTag: string[] = [];
for (let i = 0; i <= 183; i++) {
for (let i = 0; i <= 182; i++) {
cookBookMsg[ i ] = "";
}
@ -206,7 +206,5 @@ cookBookTag[181] =
'The exported "Sendable" class or function cannot be captured by "Sendable" class or function in current file (arkts-sendable-closure-export)';
cookBookTag[182] =
'Sendable functions and sendable typealias are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-sendable-beta-compatible)';
cookBookTag[183] =
'Lazy imports are not available when compatibleSdkVersionStage is lowering than beta3 of API12 (arkts-import-lazy-beta-compatible)';
}
}

View File

@ -46,7 +46,7 @@ export enum FaultID {
SendableExplicitFieldType,
SendableFunctionImportedVariables, SendableFunctionDecorator, SendableTypeAliasDecorator, SendableTypeAliasDeclaration,
SendableFunctionAssignment, SendableFunctionOverloadDecorator, SendableFunctionProperty, SendableFunctionAsExpr,
SendableDecoratorLimited, SendableClosureExport, SharedModuleExportsWarning, SendableBetaCompatible, ImportLazyBetaCompatible,
SendableDecoratorLimited, SendableClosureExport, SharedModuleExportsWarning, SendableBetaCompatible,
LAST_ID, // this should always be last enum
}
@ -171,7 +171,6 @@ faultsAttrs[FaultID.SendableDecoratorLimited] = new FaultAttributes(180);
faultsAttrs[FaultID.SendableClosureExport] = new FaultAttributes(181, false, ProblemSeverity.WARNING);
faultsAttrs[FaultID.SharedModuleExportsWarning] = new FaultAttributes(163, false, ProblemSeverity.WARNING);
faultsAttrs[FaultID.SendableBetaCompatible] = new FaultAttributes(182);
faultsAttrs[FaultID.ImportLazyBetaCompatible] = new FaultAttributes(183);
}
}
}

View File

@ -1567,7 +1567,6 @@ export class TypeScriptLinter {
if (tsImportClause.name) {
this.countDeclarationsWithDuplicateName(tsImportClause.name, tsImportClause);
}
this.checkImportLazy(tsImportClause);
}
private handleImportSpecifier(node: Node): void {
@ -2569,17 +2568,6 @@ export class TypeScriptLinter {
}
return false;
}
private checkImportLazy(tsImportClause: ImportClause): void {
if (
!tsImportClause.isLazy ||
this.compatibleSdkVersion > 12 ||
this.compatibleSdkVersion === 12 && (this.compatibleSdkVersionStage !== 'beta1' && this.compatibleSdkVersionStage !== 'beta2')
) {
return;
}
this.incrementCounters(tsImportClause, FaultID.ImportLazyBetaCompatible);
}
}
}
}

View File

@ -25,7 +25,5 @@
"testcase/arkts-sendable-generic-types/@arkts.lang.d.ets",
"testcase/arkts-sendable-obj-init/@arkts.lang.d.ets",
"testcase/arkts-no-structural-typing/@arkts.lang.d.ets",
"testcase/arkts-import-lazy-beta-compatible/arkts-import-lazy-beta-compatible-1-error.ets",
"testcase/arkts-import-lazy-beta-compatible/declarationr.ets",
"testcase/arkts-sendable-beta-compatible/arkts-sendable-beta-compatible-1-errorr.ets"]
}

View File

@ -1,16 +0,0 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import lazy { SomeClass } from './declaration';

View File

@ -1,18 +0,0 @@
/*
* Copyright (c) 2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export class SomeClass {
}

View File

@ -13224,8 +13224,7 @@ declare namespace ts {
SendableClosureExport = 108,
SharedModuleExportsWarning = 109,
SendableBetaCompatible = 110,
ImportLazyBetaCompatible = 111,
LAST_ID = 112
LAST_ID = 111
}
class FaultAttributes {
cookBookRef: number;
@ -13652,7 +13651,6 @@ declare namespace ts {
private checkAssignmentMatching;
private handleDecorator;
private isSendableDecoratorValid;
private checkImportLazy;
}
}
}

View File

@ -9278,8 +9278,7 @@ declare namespace ts {
SendableClosureExport = 108,
SharedModuleExportsWarning = 109,
SendableBetaCompatible = 110,
ImportLazyBetaCompatible = 111,
LAST_ID = 112
LAST_ID = 111
}
class FaultAttributes {
cookBookRef: number;
@ -9706,7 +9705,6 @@ declare namespace ts {
private checkAssignmentMatching;
private handleDecorator;
private isSendableDecoratorValid;
private checkImportLazy;
}
}
}