mirror of
https://gitee.com/openharmony/third_party_typescript
synced 2024-11-23 06:50:54 +00:00
!298 Fix ArkTSLinter readonly array bug for 4.1release
Merge pull request !298 from ironrain/work_0304_None_Release_1
This commit is contained in:
commit
7b55431f35
@ -193409,6 +193409,12 @@ var ts;
|
||||
((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "Array");
|
||||
}
|
||||
Utils.isGenericArrayType = isGenericArrayType;
|
||||
function isReadonlyArrayType(tsType) {
|
||||
var _a, _b, _c;
|
||||
return (isTypeReference(tsType) && ((_a = tsType.typeArguments) === null || _a === void 0 ? void 0 : _a.length) === 1 && ((_b = tsType.target.typeParameters) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
||||
(((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "ReadonlyArray"));
|
||||
}
|
||||
Utils.isReadonlyArrayType = isReadonlyArrayType;
|
||||
function isTypedArray(tsType) {
|
||||
var symbol = tsType.symbol;
|
||||
if (!symbol) {
|
||||
@ -193419,7 +193425,7 @@ var ts;
|
||||
}
|
||||
Utils.isTypedArray = isTypedArray;
|
||||
function isArray(tsType) {
|
||||
return isGenericArrayType(tsType) || isTypedArray(tsType);
|
||||
return isGenericArrayType(tsType) || isReadonlyArrayType(tsType) || isTypedArray(tsType);
|
||||
}
|
||||
Utils.isArray = isArray;
|
||||
function isTuple(tsType) {
|
||||
|
1
lib/tsserverlibrary.d.ts
vendored
1
lib/tsserverlibrary.d.ts
vendored
@ -13196,6 +13196,7 @@ declare namespace ts {
|
||||
function isPrimitiveType(type: Type): boolean;
|
||||
function isTypeSymbol(symbol: Symbol | undefined): boolean;
|
||||
function isGenericArrayType(tsType: Type): tsType is TypeReference;
|
||||
function isReadonlyArrayType(tsType: Type): boolean;
|
||||
function isTypedArray(tsType: ts.Type): boolean;
|
||||
function isArray(tsType: ts.Type): boolean;
|
||||
function isTuple(tsType: ts.Type): boolean;
|
||||
|
@ -193154,6 +193154,12 @@ var ts;
|
||||
((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "Array");
|
||||
}
|
||||
Utils.isGenericArrayType = isGenericArrayType;
|
||||
function isReadonlyArrayType(tsType) {
|
||||
var _a, _b, _c;
|
||||
return (isTypeReference(tsType) && ((_a = tsType.typeArguments) === null || _a === void 0 ? void 0 : _a.length) === 1 && ((_b = tsType.target.typeParameters) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
||||
(((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "ReadonlyArray"));
|
||||
}
|
||||
Utils.isReadonlyArrayType = isReadonlyArrayType;
|
||||
function isTypedArray(tsType) {
|
||||
var symbol = tsType.symbol;
|
||||
if (!symbol) {
|
||||
@ -193164,7 +193170,7 @@ var ts;
|
||||
}
|
||||
Utils.isTypedArray = isTypedArray;
|
||||
function isArray(tsType) {
|
||||
return isGenericArrayType(tsType) || isTypedArray(tsType);
|
||||
return isGenericArrayType(tsType) || isReadonlyArrayType(tsType) || isTypedArray(tsType);
|
||||
}
|
||||
Utils.isArray = isArray;
|
||||
function isTuple(tsType) {
|
||||
|
1
lib/typescript.d.ts
vendored
1
lib/typescript.d.ts
vendored
@ -9257,6 +9257,7 @@ declare namespace ts {
|
||||
function isPrimitiveType(type: Type): boolean;
|
||||
function isTypeSymbol(symbol: Symbol | undefined): boolean;
|
||||
function isGenericArrayType(tsType: Type): tsType is TypeReference;
|
||||
function isReadonlyArrayType(tsType: Type): boolean;
|
||||
function isTypedArray(tsType: ts.Type): boolean;
|
||||
function isArray(tsType: ts.Type): boolean;
|
||||
function isTuple(tsType: ts.Type): boolean;
|
||||
|
@ -182248,6 +182248,12 @@ var ts;
|
||||
((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "Array");
|
||||
}
|
||||
Utils.isGenericArrayType = isGenericArrayType;
|
||||
function isReadonlyArrayType(tsType) {
|
||||
var _a, _b, _c;
|
||||
return (isTypeReference(tsType) && ((_a = tsType.typeArguments) === null || _a === void 0 ? void 0 : _a.length) === 1 && ((_b = tsType.target.typeParameters) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
||||
(((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "ReadonlyArray"));
|
||||
}
|
||||
Utils.isReadonlyArrayType = isReadonlyArrayType;
|
||||
function isTypedArray(tsType) {
|
||||
var symbol = tsType.symbol;
|
||||
if (!symbol) {
|
||||
@ -182258,7 +182264,7 @@ var ts;
|
||||
}
|
||||
Utils.isTypedArray = isTypedArray;
|
||||
function isArray(tsType) {
|
||||
return isGenericArrayType(tsType) || isTypedArray(tsType);
|
||||
return isGenericArrayType(tsType) || isReadonlyArrayType(tsType) || isTypedArray(tsType);
|
||||
}
|
||||
Utils.isArray = isArray;
|
||||
function isTuple(tsType) {
|
||||
|
1
lib/typescriptServices.d.ts
vendored
1
lib/typescriptServices.d.ts
vendored
@ -9257,6 +9257,7 @@ declare namespace ts {
|
||||
function isPrimitiveType(type: Type): boolean;
|
||||
function isTypeSymbol(symbol: Symbol | undefined): boolean;
|
||||
function isGenericArrayType(tsType: Type): tsType is TypeReference;
|
||||
function isReadonlyArrayType(tsType: Type): boolean;
|
||||
function isTypedArray(tsType: ts.Type): boolean;
|
||||
function isArray(tsType: ts.Type): boolean;
|
||||
function isTuple(tsType: ts.Type): boolean;
|
||||
|
@ -182248,6 +182248,12 @@ var ts;
|
||||
((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "Array");
|
||||
}
|
||||
Utils.isGenericArrayType = isGenericArrayType;
|
||||
function isReadonlyArrayType(tsType) {
|
||||
var _a, _b, _c;
|
||||
return (isTypeReference(tsType) && ((_a = tsType.typeArguments) === null || _a === void 0 ? void 0 : _a.length) === 1 && ((_b = tsType.target.typeParameters) === null || _b === void 0 ? void 0 : _b.length) === 1 &&
|
||||
(((_c = tsType.getSymbol()) === null || _c === void 0 ? void 0 : _c.getName()) === "ReadonlyArray"));
|
||||
}
|
||||
Utils.isReadonlyArrayType = isReadonlyArrayType;
|
||||
function isTypedArray(tsType) {
|
||||
var symbol = tsType.symbol;
|
||||
if (!symbol) {
|
||||
@ -182258,7 +182264,7 @@ var ts;
|
||||
}
|
||||
Utils.isTypedArray = isTypedArray;
|
||||
function isArray(tsType) {
|
||||
return isGenericArrayType(tsType) || isTypedArray(tsType);
|
||||
return isGenericArrayType(tsType) || isReadonlyArrayType(tsType) || isTypedArray(tsType);
|
||||
}
|
||||
Utils.isArray = isArray;
|
||||
function isTuple(tsType) {
|
||||
|
@ -444,6 +444,13 @@ export function isGenericArrayType(tsType: Type): tsType is TypeReference {
|
||||
);
|
||||
}
|
||||
|
||||
export function isReadonlyArrayType(tsType: Type): boolean {
|
||||
return (
|
||||
isTypeReference(tsType) && tsType.typeArguments?.length === 1 && tsType.target.typeParameters?.length === 1 &&
|
||||
(tsType.getSymbol()?.getName() === "ReadonlyArray")
|
||||
);
|
||||
}
|
||||
|
||||
export function isTypedArray(tsType: ts.Type): boolean {
|
||||
const symbol = tsType.symbol;
|
||||
if (!symbol) {
|
||||
@ -454,7 +461,7 @@ export function isTypedArray(tsType: ts.Type): boolean {
|
||||
}
|
||||
|
||||
export function isArray(tsType: ts.Type): boolean {
|
||||
return isGenericArrayType(tsType) || isTypedArray(tsType);
|
||||
return isGenericArrayType(tsType) || isReadonlyArrayType(tsType) || isTypedArray(tsType);
|
||||
}
|
||||
|
||||
export function isTuple(tsType: ts.Type): boolean {
|
||||
|
@ -13196,6 +13196,7 @@ declare namespace ts {
|
||||
function isPrimitiveType(type: Type): boolean;
|
||||
function isTypeSymbol(symbol: Symbol | undefined): boolean;
|
||||
function isGenericArrayType(tsType: Type): tsType is TypeReference;
|
||||
function isReadonlyArrayType(tsType: Type): boolean;
|
||||
function isTypedArray(tsType: ts.Type): boolean;
|
||||
function isArray(tsType: ts.Type): boolean;
|
||||
function isTuple(tsType: ts.Type): boolean;
|
||||
|
@ -9257,6 +9257,7 @@ declare namespace ts {
|
||||
function isPrimitiveType(type: Type): boolean;
|
||||
function isTypeSymbol(symbol: Symbol | undefined): boolean;
|
||||
function isGenericArrayType(tsType: Type): tsType is TypeReference;
|
||||
function isReadonlyArrayType(tsType: Type): boolean;
|
||||
function isTypedArray(tsType: ts.Type): boolean;
|
||||
function isArray(tsType: ts.Type): boolean;
|
||||
function isTuple(tsType: ts.Type): boolean;
|
||||
|
Loading…
Reference in New Issue
Block a user