diff --git a/linter-4.2/docs/rules/recipe144.md b/linter-4.2/docs/rules/recipe144.md index 65623b38f60608c5e348ca072fc306d1dbd21e51..184e48862c4833c2927774ce6492f85f3a774fbb 100644 --- a/linter-4.2/docs/rules/recipe144.md +++ b/linter-4.2/docs/rules/recipe144.md @@ -31,8 +31,6 @@ Properties and functions of the global object: ``eval``, ``handler.has()``, ``handler.isExtensible()``, ``handler.ownKeys()``, ``handler.preventExtensions()``, ``handler.set()``, ``handler.setPrototypeOf()`` -``Array``: ``isArray`` - ``ArrayBuffer``: ``isView`` diff --git a/linter-4.2/src/TypeScriptLinter.ts b/linter-4.2/src/TypeScriptLinter.ts index 9203844e85e37e9d78cf78e94ebd9831dbea040a..a1a5e834300c7cc17c33088ca48758747f5b832a 100644 --- a/linter-4.2/src/TypeScriptLinter.ts +++ b/linter-4.2/src/TypeScriptLinter.ts @@ -1916,8 +1916,6 @@ export class TypeScriptLinter { TsUtils.LIMITED_STD_REFLECT_API.includes(name)) || (this.tsUtils.isStdProxyHandlerAPI(sym) && TsUtils.LIMITED_STD_PROXYHANDLER_API.includes(name)) || - (this.tsUtils.isStdArrayAPI(sym) && - TsUtils.LIMITED_STD_ARRAY_API.includes(name)) || (this.tsUtils.isStdArrayBufferAPI(sym) && TsUtils.LIMITED_STD_ARRAYBUFFER_API.includes(name)) ) { diff --git a/linter-4.2/src/Utils.ts b/linter-4.2/src/Utils.ts index b1e40d1d34b415565b9060841ffdc953d72d0109..491ea9d49d4497d99c210934b65c496408130cc0 100644 --- a/linter-4.2/src/Utils.ts +++ b/linter-4.2/src/Utils.ts @@ -120,7 +120,6 @@ export class TsUtils { 'apply', 'construct', 'defineProperty', 'deleteProperty', 'get', 'getOwnPropertyDescriptor', 'getPrototypeOf', 'has', 'isExtensible', 'ownKeys', 'preventExtensions', 'set', 'setPrototypeOf' ]; - static LIMITED_STD_ARRAY_API = ['isArray']; static LIMITED_STD_ARRAYBUFFER_API = ['isView']; static NON_INITIALIZABLE_PROPERTY_DECORATORS = ['Link', 'Consume', 'ObjectLink', 'Prop', 'BuilderParam']; diff --git a/linter-4.2/test/limited_stdlib_api.ts b/linter-4.2/test/limited_stdlib_api.ts index eb480cddd2a2c113b3a5e7b451205e149d3ec9cd..b04291c804c6399d064e74b0acbe82db20371534 100644 --- a/linter-4.2/test/limited_stdlib_api.ts +++ b/linter-4.2/test/limited_stdlib_api.ts @@ -90,5 +90,4 @@ if (handler.set) handler.set(c, "prop", 1, c); if (handler.setPrototypeOf) handler.setPrototypeOf(c, null); /// Array -Array.isArray([]); ArrayBuffer.isView({}); \ No newline at end of file diff --git a/linter-4.2/test/limited_stdlib_api.ts.autofix.json b/linter-4.2/test/limited_stdlib_api.ts.autofix.json index 9ef2658f09395a58687a0f3c4c3b00d685049af2..e607053a8407490d3d315b30f4427ce77f79f6b4 100644 --- a/linter-4.2/test/limited_stdlib_api.ts.autofix.json +++ b/linter-4.2/test/limited_stdlib_api.ts.autofix.json @@ -495,15 +495,7 @@ "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" }, { - "line": 94, - "column": 1, - "problem": "LimitedStdLibApi", - "autofixable": false, - "suggest": "", - "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" - }, - { - "line": 94, + "line": 93, "column": 20, "problem": "ObjectLiteralNoContextType", "autofixable": false, diff --git a/linter-4.2/test/limited_stdlib_api.ts.relax.json b/linter-4.2/test/limited_stdlib_api.ts.relax.json index a180e93c90217a48d0cdf1a3c8fef89068cb6fe4..9837d7cd32819adc22a7c7359c7577074c2eed0f 100644 --- a/linter-4.2/test/limited_stdlib_api.ts.relax.json +++ b/linter-4.2/test/limited_stdlib_api.ts.relax.json @@ -435,14 +435,7 @@ "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" }, { - "line": 94, - "column": 1, - "problem": "LimitedStdLibApi", - "suggest": "", - "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" - }, - { - "line": 94, + "line": 93, "column": 20, "problem": "ObjectLiteralNoContextType", "suggest": "", diff --git a/linter-4.2/test/limited_stdlib_api.ts.strict.json b/linter-4.2/test/limited_stdlib_api.ts.strict.json index a180e93c90217a48d0cdf1a3c8fef89068cb6fe4..9837d7cd32819adc22a7c7359c7577074c2eed0f 100644 --- a/linter-4.2/test/limited_stdlib_api.ts.strict.json +++ b/linter-4.2/test/limited_stdlib_api.ts.strict.json @@ -435,14 +435,7 @@ "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" }, { - "line": 94, - "column": 1, - "problem": "LimitedStdLibApi", - "suggest": "", - "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" - }, - { - "line": 94, + "line": 93, "column": 20, "problem": "ObjectLiteralNoContextType", "suggest": "", diff --git a/linter/docs/rules/recipe144.md b/linter/docs/rules/recipe144.md index 24579246dbdb1621056c48499886f4961f288b0b..01a07d739d6f8d105417ce303c355c3c89f3e438 100644 --- a/linter/docs/rules/recipe144.md +++ b/linter/docs/rules/recipe144.md @@ -32,8 +32,6 @@ Properties and functions of the global object: ``eval``, ``handler.has()``, ``handler.isExtensible()``, ``handler.ownKeys()``, ``handler.preventExtensions()``, ``handler.set()``, ``handler.setPrototypeOf()`` -``Array``: ``isArray`` - ``ArrayBuffer``: ``isView`` diff --git a/linter/src/TypeScriptLinter.ts b/linter/src/TypeScriptLinter.ts index 4bb4a2328b13891e862a54c12afd0f9c0eefea69..10f5ab2a117b856466b1a59f7e58e4a6a7cb5833 100644 --- a/linter/src/TypeScriptLinter.ts +++ b/linter/src/TypeScriptLinter.ts @@ -33,7 +33,6 @@ import { LIMITED_STD_GLOBAL_VAR } from './utils/consts/LimitedStdGlobalVar'; import { LIMITED_STD_OBJECT_API } from './utils/consts/LimitedStdObjectAPI'; import { LIMITED_STD_REFLECT_API } from './utils/consts/LimitedStdReflectAPI'; import { LIMITED_STD_PROXYHANDLER_API } from './utils/consts/LimitedStdProxyHandlerAPI'; -import { LIMITED_STD_ARRAY_API } from './utils/consts/LimitedStdArrayAPI'; import { LIMITED_STD_ARRAYBUFFER_API } from './utils/consts/LimitedStdArrayBufferAPI'; import { NON_INITIALIZABLE_PROPERTY_DECORATORS } from './utils/consts/NonInitializablePropertyDecorators'; import { NON_RETURN_FUNCTION_DECORATORS } from './utils/consts/NonReturnFunctionDecorators'; @@ -1542,7 +1541,6 @@ export class TypeScriptLinter { (this.tsUtils.isStdObjectAPI(sym) && LIMITED_STD_OBJECT_API.includes(name)) || (this.tsUtils.isStdReflectAPI(sym) && LIMITED_STD_REFLECT_API.includes(name)) || (this.tsUtils.isStdProxyHandlerAPI(sym) && LIMITED_STD_PROXYHANDLER_API.includes(name)) || - (this.tsUtils.isStdArrayAPI(sym) && LIMITED_STD_ARRAY_API.includes(name)) || (this.tsUtils.isStdArrayBufferAPI(sym) && LIMITED_STD_ARRAYBUFFER_API.includes(name)) ) { this.incrementCounters(callExpr, FaultID.LimitedStdLibApi); diff --git a/linter/src/utils/consts/LimitedStdArrayAPI.ts b/linter/src/utils/consts/LimitedStdArrayAPI.ts deleted file mode 100644 index ee67326c87964cbf928ab85165b51cf55c2e5ddb..0000000000000000000000000000000000000000 --- a/linter/src/utils/consts/LimitedStdArrayAPI.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2023-2023 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 const LIMITED_STD_ARRAY_API = ['isArray']; diff --git a/linter/test/limited_stdlib_api.ts b/linter/test/limited_stdlib_api.ts index 01f4a55cfdf703222064048e08117941fe5d3c22..f5228acf0d0c20e6048e8566b0f854de2699379b 100644 --- a/linter/test/limited_stdlib_api.ts +++ b/linter/test/limited_stdlib_api.ts @@ -91,5 +91,4 @@ if (handler.set) handler.set(c, "prop", 1, c); if (handler.setPrototypeOf) handler.setPrototypeOf(c, null); /// Array -Array.isArray([]); ArrayBuffer.isView({}); \ No newline at end of file diff --git a/linter/test/limited_stdlib_api.ts.autofix.json b/linter/test/limited_stdlib_api.ts.autofix.json index 48b54655dfb09c2d4755e9ca6a40160ebe1064b9..8f494137388f637280e6d3bd05336627aa13b35d 100644 --- a/linter/test/limited_stdlib_api.ts.autofix.json +++ b/linter/test/limited_stdlib_api.ts.autofix.json @@ -495,15 +495,7 @@ "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" }, { - "line": 95, - "column": 1, - "problem": "LimitedStdLibApi", - "autofixable": false, - "suggest": "", - "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" - }, - { - "line": 95, + "line": 94, "column": 20, "problem": "ObjectLiteralNoContextType", "autofixable": false, diff --git a/linter/test/limited_stdlib_api.ts.relax.json b/linter/test/limited_stdlib_api.ts.relax.json index 9dd12855d9cf9f89e9001ff8db7baf321fb70eab..629e482f3cac1165306f6d72617e3ebd46f7dc8a 100644 --- a/linter/test/limited_stdlib_api.ts.relax.json +++ b/linter/test/limited_stdlib_api.ts.relax.json @@ -435,14 +435,7 @@ "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" }, { - "line": 95, - "column": 1, - "problem": "LimitedStdLibApi", - "suggest": "", - "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" - }, - { - "line": 95, + "line": 94, "column": 20, "problem": "ObjectLiteralNoContextType", "suggest": "", diff --git a/linter/test/limited_stdlib_api.ts.strict.json b/linter/test/limited_stdlib_api.ts.strict.json index 9dd12855d9cf9f89e9001ff8db7baf321fb70eab..629e482f3cac1165306f6d72617e3ebd46f7dc8a 100644 --- a/linter/test/limited_stdlib_api.ts.strict.json +++ b/linter/test/limited_stdlib_api.ts.strict.json @@ -435,14 +435,7 @@ "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" }, { - "line": 95, - "column": 1, - "problem": "LimitedStdLibApi", - "suggest": "", - "rule": "Usage of standard library is restricted (arkts-limited-stdlib)" - }, - { - "line": 95, + "line": 94, "column": 20, "problem": "ObjectLiteralNoContextType", "suggest": "",