diff --git a/codecheck_ignore.json b/codecheck_ignore.json index e51d43f3b4a770ab232e4d3e74cebc1b0a09daa4..a30bb19d2b134825596abb32890795d7089fd638 100755 --- a/codecheck_ignore.json +++ b/codecheck_ignore.json @@ -14,7 +14,9 @@ "ets2panda/linter/arkanalyzer": "*", "ets2panda/linter/homecheck": "*", "ets2panda/linter/build_linter.py": "*", + "ets2panda/linter/src/cli/CommandLineParser.ts": "*", "ets2panda/linter/src/lib/TypeScriptLinter.ts": "*", + "ets2panda/linter/src/lib/autofixes/Autofixer.ts": "*", "ets2panda/linter/src/lib/autofixes/QuasiEditor.ts": "*", "ets2panda/linter/src/lib/statistics/scan/ProblemStatisticsCommonFunction.ts": "*", "ets2panda/linter/src/lib/utils/functions/ConfiguredRulesProcess.ts": "*", diff --git a/ets2panda/ir/ets/etsNewArrayInstanceExpression.h b/ets2panda/ir/ets/etsNewArrayInstanceExpression.h index 4d5b374cbbe956fa7309db9952c03319feb2669a..002a1cb1a6c77f928b1931de5754f4663b56d6e8 100644 --- a/ets2panda/ir/ets/etsNewArrayInstanceExpression.h +++ b/ets2panda/ir/ets/etsNewArrayInstanceExpression.h @@ -75,21 +75,6 @@ public: return defaultConstructorSignature_; } - void SetPreferredType(checker::Type *preferredType) noexcept - { - preferredType_ = preferredType; - } - - [[nodiscard]] checker::Type *GetPreferredType() noexcept - { - return preferredType_; - } - - [[nodiscard]] checker::Type const *GetPreferredType() const noexcept - { - return preferredType_; - } - void SetDimension(ir::Expression *dimension) noexcept { dimension_ = dimension; @@ -134,7 +119,6 @@ private: ir::TypeNode *typeReference_; ir::Expression *dimension_; checker::Signature *defaultConstructorSignature_ {}; - checker::Type *preferredType_ {}; }; } // namespace ark::es2panda::ir diff --git a/ets2panda/ir/ets/etsNewMultiDimArrayInstanceExpression.h b/ets2panda/ir/ets/etsNewMultiDimArrayInstanceExpression.h index 0ea42539047203dc4a9b79c2197baf68764e02be..20d8be5d48e9a3d85b32ed1a0c225e44ff92880b 100644 --- a/ets2panda/ir/ets/etsNewMultiDimArrayInstanceExpression.h +++ b/ets2panda/ir/ets/etsNewMultiDimArrayInstanceExpression.h @@ -79,21 +79,6 @@ public: return signature_; } - [[nodiscard]] checker::Type *GetPreferredType() noexcept - { - return preferredType_; - } - - [[nodiscard]] checker::Type const *GetPreferredType() const noexcept - { - return preferredType_; - } - - void SetPreferredType(checker::Type *preferredType) noexcept - { - preferredType_ = preferredType; - } - void SetSignature(checker::Signature *signature) noexcept { signature_ = signature; @@ -131,7 +116,6 @@ private: ir::TypeNode *typeReference_; ArenaVector dimensions_; checker::Signature *signature_ {}; - checker::Type *preferredType_ {}; }; } // namespace ark::es2panda::ir diff --git a/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.args.json b/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.args.json old mode 100755 new mode 100644 index b214d57430c6b63de949705fe4fc0db53c4bb327..1b80aa9e7367c4d206bb53f8fc43c77fc24045d7 --- a/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.args.json +++ b/ets2panda/linter/test/builtin/builtin_not_support_property_descriptor.ets.args.json @@ -16,4 +16,4 @@ "mode": { "arkts2": "" } - } + } \ No newline at end of file diff --git a/ets2panda/linter/test/concurrent/concurrent_decorator_arkts2.ets.migrate.json b/ets2panda/linter/test/concurrent/concurrent_decorator_arkts2.ets.migrate.json old mode 100755 new mode 100644 index 7e6581bf3ab5675cadc2e0f5cd2699190bf47443..1dde4c017ff67ea59646f54c9659df8ebbe66411 --- a/ets2panda/linter/test/concurrent/concurrent_decorator_arkts2.ets.migrate.json +++ b/ets2panda/linter/test/concurrent/concurrent_decorator_arkts2.ets.migrate.json @@ -25,4 +25,4 @@ "severity": "ERROR" } ] -} \ No newline at end of file +} diff --git a/ets2panda/linter/test/interop/increases_decreases_js_obj_js.js b/ets2panda/linter/test/interop/increases_decreases_js_obj_js.js index 2519dec8040ec17602ea393a49f1d9336d0880c8..88eed7f647dac7b416c98ab03936b753c39a5af5 100755 --- a/ets2panda/linter/test/interop/increases_decreases_js_obj_js.js +++ b/ets2panda/linter/test/interop/increases_decreases_js_obj_js.js @@ -12,6 +12,5 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -'use static' export let foo = {num: 0} diff --git a/ets2panda/linter/test/interop/interop_export_js_rules.ets.autofix.json b/ets2panda/linter/test/interop/interop_export_js_rules.ets.autofix.json deleted file mode 100644 index 58c2313941355575e380c540f740b590f10c5723..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/interop/interop_export_js_rules.ets.autofix.json +++ /dev/null @@ -1,88 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51, - "problem": "ImportAfterStatement", - "suggest": "", - "rule": "\"import\" statements after other statements are not allowed (arkts-no-misplaced-imports)", - "severity": "ERROR" - }, - { - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51, - "problem": "InterOpImportJs", - "autofix": [ - { - "start": 618, - "end": 668, - "replacementText": "", - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51 - }, - { - "start": 668, - "end": 668, - "replacementText": "let GeneratedImportVar_1 = ESObject.load('./interop_import_js_rules_js');\nlet ff1 = GeneratedImportVar_1.getPropertyByName('ff1');\n", - "line": 17, - "column": 1, - "endLine": 17, - "endColumn": 51 - } - ], - "suggest": "", - "rule": "Importing directly from \"JS\" module is not supported (arkts-interop-js2s-import-js)", - "severity": "ERROR" - }, - { - "line": 19, - "column": 1, - "endLine": 19, - "endColumn": 13, - "problem": "InteropJsObjectExport", - "suggest": "", - "rule": "Direct export of interop JS objects is not supported (arkts-interop-js2s-export-js)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 1, - "endLine": 21, - "endColumn": 51, - "problem": "InteropJsObjectExport", - "suggest": "", - "rule": "Direct export of interop JS objects is not supported (arkts-interop-js2s-export-js)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 57, - "problem": "InteropArkTs1ObjectExport", - "suggest": "", - "rule": "Direct export of interop ArkTS1.0 objects is not supported (arkts-interop-d2s-export-entity)", - "severity": "ERROR" - } - ] -} diff --git a/ets2panda/linter/test/interop/interop_export_js_rules.ets.migrate.ets b/ets2panda/linter/test/interop/interop_export_js_rules.ets.migrate.ets deleted file mode 100644 index ad8d86948bece0717323ce0a50f0afe3820ac6aa..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/interop/interop_export_js_rules.ets.migrate.ets +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ -'use static' - -let GeneratedImportVar_1 = ESObject.load('./interop_import_js_rules_js'); -let ff1 = GeneratedImportVar_1.getPropertyByName('ff1'); - - -export {ff1} // imported from js. Error is shown - -export { ff2 } from "./interop_import_js_rules_js" // ff2 is imported from js. Error is shown - -export { MyDecorator } from "./oh_modules/ets_decorator" // MyDecorator is imported from arkts1. Error is shown - -export { foo as bar } from "./oh_modules/reflect_export" // foo is imported from arkts1.2. No error. diff --git a/ets2panda/linter/test/interop/interop_export_js_rules.ets.migrate.json b/ets2panda/linter/test/interop/interop_export_js_rules.ets.migrate.json deleted file mode 100644 index 1291e15d5ef455b1073fb6db7bb313b74c2f232e..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/interop/interop_export_js_rules.ets.migrate.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 17, - "column": 5, - "endLine": 17, - "endColumn": 73, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 18, - "column": 5, - "endLine": 18, - "endColumn": 56, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 1, - "endLine": 23, - "endColumn": 51, - "problem": "InteropJsObjectExport", - "suggest": "", - "rule": "Direct export of interop JS objects is not supported (arkts-interop-js2s-export-js)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 1, - "endLine": 25, - "endColumn": 57, - "problem": "InteropArkTs1ObjectExport", - "suggest": "", - "rule": "Direct export of interop ArkTS1.0 objects is not supported (arkts-interop-d2s-export-entity)", - "severity": "ERROR" - } - ] -} diff --git a/ets2panda/linter/test/interop/static_dynamic_import.ets.args.json b/ets2panda/linter/test/interop/static_dynamic_import.ets.args.json deleted file mode 100644 index d8d3390ad9befeca9b595017d9eea0f5ada3d049..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/interop/static_dynamic_import.ets.args.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "mode": { - "arkts2": "" - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/interop/test_files/dummy_arkts1_file.ets b/ets2panda/linter/test/interop/test_files/dummy_arkts1_file.ets deleted file mode 100644 index 5aad017834822967ec7249e5db93b39b94750059..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/interop/test_files/dummy_arkts1_file.ets +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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 module arkts {} diff --git a/ets2panda/linter/test/interop/test_files/dummy_js_file.js b/ets2panda/linter/test/interop/test_files/dummy_js_file.js deleted file mode 100644 index fa09fbb12c4a5fa47c104c1173cb88dafe4b78b0..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/interop/test_files/dummy_js_file.js +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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 {} diff --git a/ets2panda/linter/test/interop/test_files/dummy_ts_file.ts b/ets2panda/linter/test/interop/test_files/dummy_ts_file.ts deleted file mode 100644 index e2f4a0e44b486d7a8c9ba88bb4c7d9dd933145be..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/interop/test_files/dummy_ts_file.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* - * Copyright (c) 2025 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 module tsModule {} diff --git a/ets2panda/linter/test/main/class_static_init.ets.args.json b/ets2panda/linter/test/main/class_static_init.ets.args.json index 4e9dc628f7cbbb3ac73a21b2ce9f794758fcaae0..3ef4496a819a201892114d1c90f78ae32053c334 100755 --- a/ets2panda/linter/test/main/class_static_init.ets.args.json +++ b/ets2panda/linter/test/main/class_static_init.ets.args.json @@ -14,7 +14,6 @@ "limitations under the License." ], "mode": { - "arkts2": "", - "autofix": "--arkts-2" + "arkts2": "" } } diff --git a/ets2panda/linter/test/main/class_static_init.ets.arkts2.json b/ets2panda/linter/test/main/class_static_init.ets.arkts2.json index a14cdf2ce588331192743a87a7aea7e46042fb3d..da2a0d8e4bbd572b5ee5126ef5bc6d2027f4a4c1 100644 --- a/ets2panda/linter/test/main/class_static_init.ets.arkts2.json +++ b/ets2panda/linter/test/main/class_static_init.ets.arkts2.json @@ -544,26 +544,6 @@ "rule": "Property 'id' has no initializer and is not definitely assigned in the constructor.", "severity": "ERROR" }, - { - "line": 148, - "column": 3, - "endLine": 148, - "endColumn": 7, - "problem": "StrictDiagnostic", - "suggest": "Property 'name' has no initializer and is not definitely assigned in the constructor.", - "rule": "Property 'name' has no initializer and is not definitely assigned in the constructor.", - "severity": "ERROR" - }, - { - "line": 147, - "column": 3, - "endLine": 147, - "endColumn": 5, - "problem": "StrictDiagnostic", - "suggest": "Property 'id' has no initializer and is not definitely assigned in the constructor.", - "rule": "Property 'id' has no initializer and is not definitely assigned in the constructor.", - "severity": "ERROR" - }, { "line": 148, "column": 3, diff --git a/ets2panda/linter/test/main/class_static_init.ets.autofix.json b/ets2panda/linter/test/main/class_static_init.ets.autofix.json deleted file mode 100644 index 2be737a16e4dfb45b6d657993f04648d89d1736b..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/class_static_init.ets.autofix.json +++ /dev/null @@ -1,876 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 21, - "column": 3, - "endLine": 21, - "endColumn": 14, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 641, - "end": 652, - "replacementText": "static a: A | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 3, - "endLine": 25, - "endColumn": 14, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 668, - "end": 679, - "replacementText": "static g: G | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 3, - "endLine": 32, - "endColumn": 15, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 753, - "end": 765, - "replacementText": "static g: G | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 36, - "column": 3, - "endLine": 36, - "endColumn": 14, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 781, - "end": 792, - "replacementText": "static a: A | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 46, - "column": 3, - "endLine": 46, - "endColumn": 29, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 933, - "end": 959, - "replacementText": "public static abc: string = \"\";" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 59, - "column": 3, - "endLine": 59, - "endColumn": 16, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1088, - "end": 1101, - "replacementText": "static b: BB | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 67, - "column": 3, - "endLine": 67, - "endColumn": 35, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1156, - "end": 1188, - "replacementText": "static config: {\n theme: string;\n} = {\n theme: \"\"\n };" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 67, - "column": 18, - "endLine": 67, - "endColumn": 19, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 1143, - "end": 1143, - "replacementText": "interface GeneratedTypeLiteralInterface_1 {\n theme: string;\n}\n" - }, - { - "start": 1171, - "end": 1187, - "replacementText": "GeneratedTypeLiteralInterface_1" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 71, - "column": 3, - "endLine": 71, - "endColumn": 23, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1205, - "end": 1225, - "replacementText": "static name: string = \"\";" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 79, - "column": 3, - "endLine": 79, - "endColumn": 38, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1314, - "end": 1349, - "replacementText": "static uninitializedString: string = \"\";" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 86, - "column": 3, - "endLine": 86, - "endColumn": 45, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1467, - "end": 1509, - "replacementText": "static uninitializedStringArray: string[] = [];" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 87, - "column": 3, - "endLine": 87, - "endColumn": 45, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1512, - "end": 1554, - "replacementText": "static uninitializedNumberArray: number[] = [];" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 88, - "column": 3, - "endLine": 88, - "endColumn": 53, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1557, - "end": 1607, - "replacementText": "static uninitializedObjectArray: {\n id: number;\n }[] = [];" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 88, - "column": 36, - "endLine": 88, - "endColumn": 37, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 1446, - "end": 1446, - "replacementText": "interface GeneratedTypeLiteralInterface_2 {\n id: number;\n}\n" - }, - { - "start": 1590, - "end": 1604, - "replacementText": "GeneratedTypeLiteralInterface_2" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 89, - "column": 3, - "endLine": 89, - "endColumn": 55, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1610, - "end": 1662, - "replacementText": "static uninitializedUnionArray: (string | number)[] = [];" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 94, - "column": 3, - "endLine": 94, - "endColumn": 67, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1704, - "end": 1768, - "replacementText": "static uninitializedSimpleObject: {\n name: string;\n age: number;\n} = {\n name: \"\"\n };" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 94, - "column": 37, - "endLine": 94, - "endColumn": 38, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 1682, - "end": 1682, - "replacementText": "interface GeneratedTypeLiteralInterface_3 {\n name: string;\n age: number;\n}\n" - }, - { - "start": 1738, - "end": 1767, - "replacementText": "GeneratedTypeLiteralInterface_3" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 95, - "column": 3, - "endLine": 101, - "endColumn": 5, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1771, - "end": 1895, - "replacementText": "static uninitializedNestedObject: {\n id: number;\n metadata: {\n createdAt: Date;\n tags: string[];\n };\n} = {\n metadata: {\n createdAt: new Date(),\n tags: []\n }\n };" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 95, - "column": 37, - "endLine": 95, - "endColumn": 38, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 1682, - "end": 1682, - "replacementText": "interface GeneratedTypeLiteralInterface_4 {\n id: number;\n metadata: {\n createdAt: Date;\n tags: string[];\n };\n}\n" - }, - { - "start": 1805, - "end": 1894, - "replacementText": "GeneratedTypeLiteralInterface_4" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 97, - "column": 15, - "endLine": 97, - "endColumn": 16, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 1682, - "end": 1682, - "replacementText": "interface GeneratedTypeLiteralInterface_5 {\n createdAt: Date;\n tags: string[];\n}\n" - }, - { - "start": 1837, - "end": 1889, - "replacementText": "GeneratedTypeLiteralInterface_5" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 106, - "column": 3, - "endLine": 106, - "endColumn": 34, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1948, - "end": 1979, - "replacementText": "static uninitializedDate: Date = new Date();" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 107, - "column": 3, - "endLine": 107, - "endColumn": 48, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 1982, - "end": 2027, - "replacementText": "static uninitializedMap: Map = new Map();" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 108, - "column": 3, - "endLine": 108, - "endColumn": 40, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 2030, - "end": 2067, - "replacementText": "static uninitializedSet: Set = new Set();" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 109, - "column": 3, - "endLine": 109, - "endColumn": 46, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 2070, - "end": 2113, - "replacementText": "static uninitializedPromise: Promise = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 114, - "column": 3, - "endLine": 114, - "endColumn": 46, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 115, - "column": 3, - "endLine": 115, - "endColumn": 72, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 115, - "column": 37, - "endLine": 115, - "endColumn": 71, - "problem": "IntersectionType", - "suggest": "", - "rule": "Use inheritance instead of intersection types (arkts-no-intersection-types)", - "severity": "ERROR" - }, - { - "line": 115, - "column": 37, - "endLine": 115, - "endColumn": 38, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 2149, - "end": 2149, - "replacementText": "interface GeneratedTypeLiteralInterface_6 {\n name: string;\n}\n" - }, - { - "start": 2253, - "end": 2269, - "replacementText": "GeneratedTypeLiteralInterface_6" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 115, - "column": 56, - "endLine": 115, - "endColumn": 57, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 2149, - "end": 2149, - "replacementText": "interface GeneratedTypeLiteralInterface_7 {\n age: number;\n}\n" - }, - { - "start": 2272, - "end": 2287, - "replacementText": "GeneratedTypeLiteralInterface_7" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 116, - "column": 3, - "endLine": 116, - "endColumn": 57, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 128, - "column": 3, - "endLine": 128, - "endColumn": 41, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 2567, - "end": 2605, - "replacementText": "static uninitializedGenericArray: T[] = [];" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 129, - "column": 3, - "endLine": 129, - "endColumn": 39, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 2608, - "end": 2644, - "replacementText": "static uninitializedGenericValue: T | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 134, - "column": 3, - "endLine": 134, - "endColumn": 44, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 135, - "column": 3, - "endLine": 135, - "endColumn": 60, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 140, - "column": 3, - "endLine": 140, - "endColumn": 91, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 140, - "column": 43, - "endLine": 140, - "endColumn": 44, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 2821, - "end": 2821, - "replacementText": "interface GeneratedTypeLiteralInterface_8 {\n id: number;\n data: Map>;\n}\n" - }, - { - "start": 2884, - "end": 2930, - "replacementText": "GeneratedTypeLiteralInterface_8" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 141, - "column": 3, - "endLine": 141, - "endColumn": 65, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 2935, - "end": 2997, - "replacementText": "static uninitializedRecord: Record | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 141, - "column": 46, - "endLine": 141, - "endColumn": 47, - "problem": "ObjectTypeLiteral", - "autofix": [ - { - "start": 2821, - "end": 2821, - "replacementText": "interface GeneratedTypeLiteralInterface_9 {\n value: number;\n}\n" - }, - { - "start": 2978, - "end": 2995, - "replacementText": "GeneratedTypeLiteralInterface_9" - } - ], - "suggest": "", - "rule": "Object literals cannot be used as type declarations (arkts-no-obj-literals-as-types)", - "severity": "ERROR" - }, - { - "line": 142, - "column": 3, - "endLine": 142, - "endColumn": 57, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 152, - "column": 3, - "endLine": 152, - "endColumn": 34, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 3153, - "end": 3184, - "replacementText": "static uninitializedUser: User | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 153, - "column": 3, - "endLine": 153, - "endColumn": 37, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 3187, - "end": 3221, - "replacementText": "static uninitializedUsers: User[] = [];" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 163, - "column": 3, - "endLine": 163, - "endColumn": 38, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 3297, - "end": 3332, - "replacementText": "static uninitializedStatus: Status | undefined = undefined;" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 164, - "column": 3, - "endLine": 164, - "endColumn": 45, - "problem": "ClassstaticInitialization", - "autofix": [ - { - "start": 3335, - "end": 3377, - "replacementText": "static uninitializedStatusArray: Status[] = [];" - } - ], - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 169, - "column": 3, - "endLine": 169, - "endColumn": 36, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 170, - "column": 3, - "endLine": 170, - "endColumn": 40, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 170, - "column": 32, - "endLine": 170, - "endColumn": 39, - "problem": "UnknownType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 171, - "column": 3, - "endLine": 171, - "endColumn": 32, - "problem": "ClassstaticInitialization", - "suggest": "", - "rule": "The static property has no initializer (arkts-class-static-initialization)", - "severity": "ERROR" - }, - { - "line": 171, - "column": 28, - "endLine": 171, - "endColumn": 31, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 42, - "column": 2, - "endLine": 42, - "endColumn": 7, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport { Entry, Component, State, Text } from '@kit.ArkUI';" - } - ], - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 43, - "column": 2, - "endLine": 43, - "endColumn": 11, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport { Entry, Component, State, Text } from '@kit.ArkUI';" - } - ], - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 4, - "endLine": 45, - "endColumn": 9, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport { Entry, Component, State, Text } from '@kit.ArkUI';" - } - ], - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 7, - "endLine": 49, - "endColumn": 11, - "problem": "UIInterfaceImport", - "autofix": [ - { - "start": 603, - "end": 603, - "replacementText": "\n\nimport { Entry, Component, State, Text } from '@kit.ArkUI';" - } - ], - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 147, - "column": 3, - "endLine": 147, - "endColumn": 5, - "problem": "StrictDiagnostic", - "suggest": "Property 'id' has no initializer and is not definitely assigned in the constructor.", - "rule": "Property 'id' has no initializer and is not definitely assigned in the constructor.", - "severity": "ERROR" - }, - { - "line": 148, - "column": 3, - "endLine": 148, - "endColumn": 7, - "problem": "StrictDiagnostic", - "suggest": "Property 'name' has no initializer and is not definitely assigned in the constructor.", - "rule": "Property 'name' has no initializer and is not definitely assigned in the constructor.", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/debugger_statememt.ets.migrate.ets b/ets2panda/linter/test/main/debugger_statememt.ets.migrate.ets deleted file mode 100644 index 04eeeb8969692e0bcd2becb26ad2df9437c05370..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/debugger_statememt.ets.migrate.ets +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -specialAutofixLib.debugger(); - -function a() { - specialAutofixLib.debugger(); -} - -console.log('debugger'); \ No newline at end of file diff --git a/ets2panda/linter/test/main/debugger_statememt.ets.migrate.json b/ets2panda/linter/test/main/debugger_statememt.ets.migrate.json deleted file mode 100644 index ca88f857e960b437dcf767c0ac40be998c8f1236..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/debugger_statememt.ets.migrate.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/double_excla_binding_3.ets b/ets2panda/linter/test/main/double_excla_binding_3.ets index 4eff7d72ca3ee156d45a177adebae4a03340c2a7..8c9dcc1e87d92cb935d8ab70085acccafdaa580a 100644 --- a/ets2panda/linter/test/main/double_excla_binding_3.ets +++ b/ets2panda/linter/test/main/double_excla_binding_3.ets @@ -29,4 +29,4 @@ struct MyComponent { Text(this.user!!!.name) } } -} +} \ No newline at end of file diff --git a/ets2panda/linter/test/main/global_this.ets.migrate.ets b/ets2panda/linter/test/main/global_this.ets.migrate.ets deleted file mode 100644 index d1fb5d519f174c046533036129ee9e5653352f72..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/global_this.ets.migrate.ets +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2022-2025 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. - */ - -const pi: number = 3.1416; - -function circleArea(r: number): number { - foo(globalThis); - - return specialAutofixLib.globalThis.get("pi") * r * r; -} - -function foo(x: any): void { - console.log(x.pi); -} - -specialAutofixLib.globalThis.set("abc", 200); - -const value = specialAutofixLib.globalThis.get("obj").prop; - -delete specialAutofixLib.globalThis.get("property"); - -globalThisprop = 100; - -specialAutofixLib.globalThis.get("pi"); - -specialAutofixLib.globalThis.set("pi",3.1416); - -specialAutofixLib.globalThis; - diff --git a/ets2panda/linter/test/main/global_this.ets.migrate.json b/ets2panda/linter/test/main/global_this.ets.migrate.json deleted file mode 100644 index cdc3cef837269d89e24bee549595845bda5cc72b..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/global_this.ets.migrate.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 19, - "column": 7, - "endLine": 19, - "endColumn": 17, - "problem": "GlobalThisError", - "suggest": "", - "rule": "\"globalThis\" is not supported (arkts-no-globalthis)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 17, - "endLine": 24, - "endColumn": 20, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 7, - "endLine": 30, - "endColumn": 59, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 1, - "endLine": 32, - "endColumn": 7, - "problem": "DeleteOperator", - "suggest": "", - "rule": "\"delete\" operator is not supported (arkts-no-delete)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets b/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets deleted file mode 100644 index 7f83645b5e8aa5d4df1227701293a81aa80a7897..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -class User { - name: string = "" - age: number = 0 -} - -@Entry -@Component -struct FatherComponent { - @Prop user1: User = new User() - @StorageLink("user2") user2: User = new User() - @LocalStorageLink("user3") user3: User = new User() - - build() { - } -} - -@Component -struct ChildComponent { - @StorageProp("user2") user2: User = new User() - @LocalStorageProp("user3") user3: User = new User() - - build() { - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.args.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.args.json deleted file mode 100644 index 4acc088d1da62353e56ced57f16b342de413cb78..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.args.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "mode": { - "arkts2": "" - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.arkts2.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.arkts2.json deleted file mode 100644 index eda4a3c782419fa3f42038746047f40637c8b8ec..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.arkts2.json +++ /dev/null @@ -1,128 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 24, - "column": 3, - "endLine": 24, - "endColumn": 33, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 3, - "endLine": 34, - "endColumn": 49, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 35, - "column": 3, - "endLine": 35, - "endColumn": 54, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 2, - "endLine": 21, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 22, - "column": 2, - "endLine": 22, - "endColumn": 11, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 4, - "endLine": 24, - "endColumn": 8, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 4, - "endLine": 25, - "endColumn": 15, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 26, - "column": 4, - "endLine": 26, - "endColumn": 20, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 2, - "endLine": 32, - "endColumn": 11, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 4, - "endLine": 34, - "endColumn": 15, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 35, - "column": 4, - "endLine": 35, - "endColumn": 20, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.json deleted file mode 100644 index ca88f857e960b437dcf767c0ac40be998c8f1236..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_1.ets.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets b/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets deleted file mode 100644 index f218bde1db65360c1d8e33e6bebc75814dded0a9..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -class MyClassA { - -} - -let para: Record = { 'PropA': 47 } -let storage: LocalStorage = new LocalStorage(para) -let prop1 = storage.prop('PropA') -let prop2 = storage.prop('PropA') -let prop3 = storage.prop('PropA') -let prop4: SubscribedAbstractProperty = storage.prop('PropA') -let prop5: SubscribedAbstractProperty = storage.prop('PropA') -let prop6: SubscribedAbstractProperty = storage.prop('PropA') - -AppStorage.SetOrCreate('PropB', 46) -let prop7 = AppStorage.prop('PropB') -let prop8 = AppStorage.prop('PropB') -let prop9 = AppStorage.prop('PropB') -let prop10: SubscribedAbstractProperty = AppStorage.prop('PropB') -let prop11: SubscribedAbstractProperty = AppStorage.prop('PropB') -let prop12: SubscribedAbstractProperty = AppStorage.prop('PropB') - -@Entry -@Component -struct MyComponent { - - aboutToAppear(): void { - let storage = LocalStorage.getShared() - let prop1 = storage.prop('PropA') - let prop2: SubscribedAbstractProperty = storage.prop('PropA') - } - - build() { - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.args.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.args.json deleted file mode 100644 index 4acc088d1da62353e56ced57f16b342de413cb78..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.args.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "mode": { - "arkts2": "" - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.arkts2.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.arkts2.json deleted file mode 100644 index a34c53714857c59f1233360467e425e46bc04227..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.arkts2.json +++ /dev/null @@ -1,448 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 21, - "column": 33, - "endLine": 21, - "endColumn": 45, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 22, - "column": 5, - "endLine": 22, - "endColumn": 42, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 22, - "column": 5, - "endLine": 22, - "endColumn": 42, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 5, - "endLine": 23, - "endColumn": 44, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 5, - "endLine": 23, - "endColumn": 44, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 5, - "endLine": 24, - "endColumn": 53, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 5, - "endLine": 24, - "endColumn": 53, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 5, - "endLine": 25, - "endColumn": 70, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 26, - "column": 5, - "endLine": 26, - "endColumn": 72, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 27, - "column": 5, - "endLine": 27, - "endColumn": 81, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 5, - "endLine": 30, - "endColumn": 45, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 5, - "endLine": 30, - "endColumn": 45, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 13, - "endLine": 30, - "endColumn": 45, - "problem": "NumericSemantics", - "suggest": "", - "rule": "Numeric semantics is different for integer values (arkts-numeric-semantic)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 47, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 47, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 5, - "endLine": 32, - "endColumn": 56, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 5, - "endLine": 32, - "endColumn": 56, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 5, - "endLine": 33, - "endColumn": 74, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 5, - "endLine": 34, - "endColumn": 76, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 35, - "column": 5, - "endLine": 35, - "endColumn": 85, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 42, - "column": 13, - "endLine": 42, - "endColumn": 47, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 43, - "column": 13, - "endLine": 43, - "endColumn": 52, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 43, - "column": 13, - "endLine": 43, - "endColumn": 52, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 13, - "endLine": 44, - "endColumn": 80, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 14, - "endLine": 21, - "endColumn": 26, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 21, - "column": 33, - "endLine": 21, - "endColumn": 45, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 25, - "column": 12, - "endLine": 25, - "endColumn": 38, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 26, - "column": 12, - "endLine": 26, - "endColumn": 38, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 27, - "column": 12, - "endLine": 27, - "endColumn": 38, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 29, - "column": 1, - "endLine": 29, - "endColumn": 11, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 13, - "endLine": 30, - "endColumn": 23, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 13, - "endLine": 31, - "endColumn": 23, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 13, - "endLine": 32, - "endColumn": 23, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 13, - "endLine": 33, - "endColumn": 39, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 33, - "column": 50, - "endLine": 33, - "endColumn": 60, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 13, - "endLine": 34, - "endColumn": 39, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 34, - "column": 52, - "endLine": 34, - "endColumn": 62, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 35, - "column": 13, - "endLine": 35, - "endColumn": 39, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 35, - "column": 61, - "endLine": 35, - "endColumn": 71, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 37, - "column": 2, - "endLine": 37, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 38, - "column": 2, - "endLine": 38, - "endColumn": 11, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 42, - "column": 23, - "endLine": 42, - "endColumn": 35, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 20, - "endLine": 44, - "endColumn": 46, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.json deleted file mode 100644 index 897276b6ebb2bfcd6175508d9288d7154b6a58a1..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_2.ets.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 22, - "column": 5, - "endLine": 22, - "endColumn": 42, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 23, - "column": 5, - "endLine": 23, - "endColumn": 44, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 24, - "column": 5, - "endLine": 24, - "endColumn": 53, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 30, - "column": 5, - "endLine": 30, - "endColumn": 45, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 31, - "column": 5, - "endLine": 31, - "endColumn": 47, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 32, - "column": 5, - "endLine": 32, - "endColumn": 56, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 42, - "column": 13, - "endLine": 42, - "endColumn": 47, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 43, - "column": 13, - "endLine": 43, - "endColumn": 52, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets b/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets deleted file mode 100644 index 5a75d8e00d8979f2a84a8fd4ec69e4e3899dfff0..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2025 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. - */1q - -class MyClassA { - -} - -class MyClassB { - -} - -function getClass1 { - let a = new MyClassA() - - if (1 > 0) { - return new MyClassB() - } else { - return a - } -} - -function getClass2 { - if (1 > 0) { - return 1 - } else { - return new MyClassA() - } -} - -let para: Record = { 'PropA': 47 } -let storage: LocalStorage = new LocalStorage(para) -let prop1 = storage.setAndProp('PropA', getClass1()) -let prop2 = storage.setAndProp('PropA', getClass2()) -let prop3 = storage.setAndProp('PropA', {name: "jack", age: 2}) -let prop4 = storage.setAndProp('PropA', 1 > 0 ? 1 : getClass1()) -let prop5 = storage.setAndProp('PropA', 1 > 0 ? {name: "jack"} : "test") -let prop6 = storage.setAndProp('PropA', new MyClassA()) -let prop7 = storage.setAndProp('PropA', 1) -let prop8 = storage.setAndProp('PropA', "test") -let prop9 = storage.setAndProp('PropA', true) - -@Entry -@Component -struct MyComponent { - build() { - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.args.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.args.json deleted file mode 100644 index 4acc088d1da62353e56ced57f16b342de413cb78..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.args.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "mode": { - "arkts2": "" - } -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.arkts2.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.arkts2.json deleted file mode 100644 index aae50874a93b096af39198a74ec4c1311c7aeb9e..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.arkts2.json +++ /dev/null @@ -1,248 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 43, - "column": 33, - "endLine": 43, - "endColumn": 45, - "problem": "DynamicCtorCall", - "suggest": "", - "rule": "\"new\" expression with dynamic constructor type is not supported (arkts-no-dynamic-ctor-call)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 53, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 53, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 5, - "endLine": 45, - "endColumn": 53, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 5, - "endLine": 45, - "endColumn": 53, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 46, - "column": 5, - "endLine": 46, - "endColumn": 64, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 46, - "column": 5, - "endLine": 46, - "endColumn": 64, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 47, - "column": 5, - "endLine": 47, - "endColumn": 65, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 47, - "column": 5, - "endLine": 47, - "endColumn": 65, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 48, - "column": 5, - "endLine": 48, - "endColumn": 73, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 48, - "column": 5, - "endLine": 48, - "endColumn": 73, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 5, - "endLine": 49, - "endColumn": 56, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 5, - "endLine": 49, - "endColumn": 56, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 50, - "column": 5, - "endLine": 50, - "endColumn": 43, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 50, - "column": 5, - "endLine": 50, - "endColumn": 43, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 51, - "column": 5, - "endLine": 51, - "endColumn": 48, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 51, - "column": 5, - "endLine": 51, - "endColumn": 48, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 5, - "endLine": 52, - "endColumn": 46, - "problem": "PropDecoratorsAndInterfacesAreNotSupported", - "suggest": "", - "rule": "The \"Prop\", \"StorageProp\", and \"LocalStorageProp\" decorators, as well as the \"prop\" and \"setAndProp\" interfaces, are not supported (arkui-no-specific-prop-decorators-and-interfaces)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 5, - "endLine": 52, - "endColumn": 46, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 43, - "column": 14, - "endLine": 43, - "endColumn": 26, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 43, - "column": 33, - "endLine": 43, - "endColumn": 45, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 54, - "column": 2, - "endLine": 54, - "endColumn": 7, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - }, - { - "line": 55, - "column": 2, - "endLine": 55, - "endColumn": 11, - "problem": "UIInterfaceImport", - "suggest": "", - "rule": "ArkUI interface should be imported before using (arkui-modular-interface)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.json b/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.json deleted file mode 100644 index de7a4258a1f6b8da812a9b2a4c008c68ffd109f1..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_decorator_and_interfaces_3.ets.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 44, - "column": 5, - "endLine": 44, - "endColumn": 53, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 45, - "column": 5, - "endLine": 45, - "endColumn": 53, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 46, - "column": 5, - "endLine": 46, - "endColumn": 64, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 47, - "column": 5, - "endLine": 47, - "endColumn": 65, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 48, - "column": 5, - "endLine": 48, - "endColumn": 73, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 49, - "column": 5, - "endLine": 49, - "endColumn": 56, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 50, - "column": 5, - "endLine": 50, - "endColumn": 43, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 51, - "column": 5, - "endLine": 51, - "endColumn": 48, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - }, - { - "line": 52, - "column": 5, - "endLine": 52, - "endColumn": 46, - "problem": "AnyType", - "suggest": "", - "rule": "Use explicit types instead of \"any\", \"unknown\" (arkts-no-any-unknown)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_name_from_value.ets b/ets2panda/linter/test/main/prop_name_from_value.ets deleted file mode 100644 index bdfdc1a80d5529ad17bdec94f11f1a0e7e493de8..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_name_from_value.ets +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2025 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. - */ - -enum TEST { - A, - B, - C -} -const arr = ['a', 'b', 'c']; - -const val = TEST[1]; -const value: number = TEST.A; //legal -const arrVal = arr[1]; //legal \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_name_from_value.ets.args.json b/ets2panda/linter/test/main/prop_name_from_value.ets.args.json deleted file mode 100644 index 66fb88f85945924e8be0e83d90123507033f4c5d..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_name_from_value.ets.args.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "mode": { - "arkts2": "" - } -} diff --git a/ets2panda/linter/test/main/prop_name_from_value.ets.arkts2.json b/ets2panda/linter/test/main/prop_name_from_value.ets.arkts2.json deleted file mode 100644 index 4218268d314b5d23e17b0cb47ab709da3f410059..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_name_from_value.ets.arkts2.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [ - { - "line": 23, - "column": 13, - "endLine": 23, - "endColumn": 20, - "problem": "UnsupportPropNameFromValue", - "suggest": "", - "rule": "Enum cannot get member name by member value (arkts-unsupport-prop-name-from-value)", - "severity": "ERROR" - } - ] -} \ No newline at end of file diff --git a/ets2panda/linter/test/main/prop_name_from_value.ets.json b/ets2panda/linter/test/main/prop_name_from_value.ets.json deleted file mode 100644 index ca88f857e960b437dcf767c0ac40be998c8f1236..0000000000000000000000000000000000000000 --- a/ets2panda/linter/test/main/prop_name_from_value.ets.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "copyright": [ - "Copyright (c) 2025 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." - ], - "result": [] -} \ No newline at end of file diff --git a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test2.ets b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test2.ets index 7fbea40572514d454dd7dd155ae43746e2c46a2e..7656872082259533c237005afc004ffbbcc3a816 100644 --- a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test2.ets +++ b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test2.ets @@ -19,5 +19,5 @@ function foo (p: [int, string]) { let x: Readonly<[int, string]> = [] /* @@ label */foo(/* @@ label1 */x) -/* @@@ label1 Error TypeError: Type 'readonly [int, String]' is not compatible with type '[int, String]' at index 1 */ -/* @@@ label Error TypeError: No matching call signature for foo(readonly [int, String]) */ +/* @@@ label1 Error TypeError: Type 'readonly [Int, String]' is not compatible with type '[Int, String]' at index 1 */ +/* @@@ label Error TypeError: No matching call signature for foo(readonly [Int, String]) */ diff --git a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test3.ets b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test3.ets index 0953054d474f4d57fee200f49df0951afa76a56d..1d321b90e4c8c89fcfe3c7f036f06e63f0993d80 100644 --- a/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test3.ets +++ b/ets2panda/test/ast/parser/ets/readonly-parameter-test/Readonly-with-ArrayType-test3.ets @@ -17,4 +17,4 @@ function foo (x: Readonly<[int, string]>) { let y: [int, string] = /* @@ label */x } -/* @@@ label Error TypeError: Type 'readonly [int, String]' cannot be assigned to type '[int, String]' */ +/* @@@ label Error TypeError: Type 'readonly [Int, String]' cannot be assigned to type '[Int, String]' */ diff --git a/ets2panda/test/ast/parser/ets/readonly-parameter-test/readonly-parameter-test2.ets b/ets2panda/test/ast/parser/ets/readonly-parameter-test/readonly-parameter-test2.ets index fd6e6d841963f901bc18f99637d0a7901557daaf..12e4c37feda06db8e2dc233337fc66b095ca17bf 100644 --- a/ets2panda/test/ast/parser/ets/readonly-parameter-test/readonly-parameter-test2.ets +++ b/ets2panda/test/ast/parser/ets/readonly-parameter-test/readonly-parameter-test2.ets @@ -18,4 +18,4 @@ function foo (x: readonly [int, string]) { let y: [int, string] = /* @@ label */x } -/* @@@ label Error TypeError: Type 'readonly [int, String]' cannot be assigned to type '[int, String]' */ +/* @@@ label Error TypeError: Type 'readonly [Int, String]' cannot be assigned to type '[Int, String]' */ diff --git a/ets2panda/test/compiler/ets/rethrowingCheck1-expected.txt b/ets2panda/test/compiler/ets/rethrowingCheck1-expected.txt deleted file mode 100644 index c971b8965f88cc9b6f7bcce7c6e4367ca2db13be..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/rethrowingCheck1-expected.txt +++ /dev/null @@ -1,787 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 16, - "column": 13, - "program": "rethrowingCheck1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 16, - "column": 13, - "program": "rethrowingCheck1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 17, - "column": 24, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "rethrowingCheck1.ets" - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "I am an exception", - "loc": { - "start": { - "line": 17, - "column": 25, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 17, - "column": 44, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 11, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 17, - "column": 46, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 17, - "column": 46, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 23, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 20, - "column": 13, - "program": "rethrowingCheck1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 20, - "column": 13, - "program": "rethrowingCheck1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 23, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "rethrowingCheck1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 17, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "rethrowingCheck1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 14, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 14, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 9, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 22, - "column": 12, - "program": "rethrowingCheck1.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 9, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 22, - "column": 15, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 9, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 23, - "column": 6, - "program": "rethrowingCheck1.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 17, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 25, - "column": 6, - "program": "rethrowingCheck1.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 14, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 23, - "column": 15, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 7, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 25, - "column": 6, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 21, - "column": 5, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 25, - "column": 6, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 45, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck1.ets" - }, - "end": { - "line": 27, - "column": 1, - "program": "rethrowingCheck1.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/rethrowingCheck4-expected.txt b/ets2panda/test/compiler/ets/rethrowingCheck4-expected.txt deleted file mode 100644 index ffd83cec5b9c5f998fa009ec3a2e05f8cf8620d6..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/rethrowingCheck4-expected.txt +++ /dev/null @@ -1,926 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "b", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 16, - "column": 11, - "program": "rethrowingCheck4.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "b", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 16, - "column": 11, - "program": "rethrowingCheck4.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "foo", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 23, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 16, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 16, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 12, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 16, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 12, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 16, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 17, - "column": 8, - "program": "rethrowingCheck4.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 17, - "column": 10, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 17, - "column": 11, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 45, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 20, - "column": 13, - "program": "rethrowingCheck4.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 20, - "column": 13, - "program": "rethrowingCheck4.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 15, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 21, - "column": 24, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 21, - "column": 25, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 21, - "column": 25, - "program": "rethrowingCheck4.ets" - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "I am an exception", - "loc": { - "start": { - "line": 21, - "column": 25, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 21, - "column": 44, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 11, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 21, - "column": 46, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 5, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 21, - "column": 46, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 23, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 24, - "column": 13, - "program": "rethrowingCheck4.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 24, - "column": 13, - "program": "rethrowingCheck4.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 24, - "column": 23, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 24, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 24, - "column": 17, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 24, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 14, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 24, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 14, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 24, - "column": 27, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "b", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 25, - "column": 6, - "program": "rethrowingCheck4.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 5, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 25, - "column": 8, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 25, - "column": 9, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 45, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 24, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 10, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingCheck4.ets" - }, - "end": { - "line": 27, - "column": 1, - "program": "rethrowingCheck4.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/rethrowingConstructorCheck3-expected.txt b/ets2panda/test/compiler/ets/rethrowingConstructorCheck3-expected.txt deleted file mode 100644 index 1a0939cc0cf5ae5d42f94d29f0249fa4ad361098..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/rethrowingConstructorCheck3-expected.txt +++ /dev/null @@ -1,853 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 16, - "column": 16, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 24, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 17, - "column": 18, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 46, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 48, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 48, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 48, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 17, - "column": 48, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 9, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 9, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 22, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 22, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 26, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 30, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 38, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 18, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 22, - "column": 22, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 9, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 17, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 26, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 17, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 27, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 17, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 27, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 27, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 39, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 13, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 41, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 9, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 41, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 24, - "column": 5, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 24, - "column": 41, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 7, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 25, - "column": 4, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 25, - "column": 15, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 25, - "column": 17, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 12, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 25, - "column": 13, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 5, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 25, - "column": 17, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 23, - "column": 3, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 25, - "column": 17, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 23, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - }, - "end": { - "line": 27, - "column": 1, - "program": "rethrowingConstructorCheck3.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/rethrowingFunctionCheck3-expected.txt b/ets2panda/test/compiler/ets/rethrowingFunctionCheck3-expected.txt deleted file mode 100644 index 811fac12b9c8b46a33195195d34e1bd9f9b17928..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/rethrowingFunctionCheck3-expected.txt +++ /dev/null @@ -1,754 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 32, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 36, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 26, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 36, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 23, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 36, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 23, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 36, - "program": "rethrowingFunctionCheck3.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 46, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 50, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 60, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 62, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 62, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 62, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 62, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunctionToo", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 25, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunctionToo", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 25, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 29, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 33, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 41, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 43, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 43, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 43, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 43, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 20, - "column": 14, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 20, - "column": 14, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 18, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 20, - "column": 22, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 17, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "TestFunctionToo", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 18, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 33, - "program": "rethrowingFunctionCheck3.ets" - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 34, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 35, - "program": "rethrowingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 7, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 15, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 12, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 23, - "column": 13, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "rethrowingFunctionCheck3.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "rethrowingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 23, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "rethrowingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - }, - "end": { - "line": 25, - "column": 1, - "program": "rethrowingFunctionCheck3.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/rethrowingMethodCheck3-expected.txt b/ets2panda/test/compiler/ets/rethrowingMethodCheck3-expected.txt deleted file mode 100644 index 270f5b70663e1208732eb8528dae02d8a6ff60d0..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/rethrowingMethodCheck3-expected.txt +++ /dev/null @@ -1,1056 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 16, - "column": 16, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testMethod", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 13, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testMethod", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 13, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 23, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 27, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 17, - "column": 17, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 27, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 27, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 27, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 37, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 41, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 51, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 53, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 53, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 53, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 17, - "column": 53, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 9, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 9, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 22, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 22, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 26, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 30, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 38, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 18, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 22, - "column": 22, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "testClass", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 7, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 23, - "column": 16, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 23, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 23, - "column": 32, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 23, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 23, - "column": 33, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 23, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 23, - "column": 33, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 23, - "column": 19, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 23, - "column": 35, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 7, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 23, - "column": 35, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 23, - "column": 3, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 23, - "column": 35, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "testClass", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 5, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 26, - "column": 14, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "testMethod", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 15, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 26, - "column": 25, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 5, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 26, - "column": 25, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 26, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 26, - "column": 38, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 26, - "column": 5, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 26, - "column": 39, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 5, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 26, - "column": 40, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 25, - "column": 7, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 27, - "column": 4, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 27, - "column": 15, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 27, - "column": 17, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 12, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 27, - "column": 13, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 27, - "column": 17, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 25, - "column": 3, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 27, - "column": 17, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 23, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - }, - "end": { - "line": 29, - "column": 1, - "program": "rethrowingMethodCheck3.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/throwInRethrowingFunction2-expected.txt b/ets2panda/test/compiler/ets/throwInRethrowingFunction2-expected.txt deleted file mode 100644 index 0206339f3231dcfc682db447febd9932e448d7a1..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/throwInRethrowingFunction2-expected.txt +++ /dev/null @@ -1,662 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "RethrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 16, - "column": 24, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "RethrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 16, - "column": 24, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 34, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 16, - "column": 38, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 28, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 16, - "column": 38, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 25, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 16, - "column": 38, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 25, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 16, - "column": 38, - "program": "throwInRethrowingFunction2.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 15, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 18, - "column": 24, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 18, - "column": 25, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 18, - "column": 25, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 18, - "column": 11, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "throwInRethrowingFunction2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 17, - "column": 7, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 19, - "column": 4, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 15, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 19, - "column": 17, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 12, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 19, - "column": 13, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 19, - "column": 17, - "program": "throwInRethrowingFunction2.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 19, - "column": 17, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "f", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 21, - "column": 4, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 21, - "column": 6, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 21, - "column": 7, - "program": "throwInRethrowingFunction2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 56, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 22, - "column": 2, - "program": "throwInRethrowingFunction2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - }, - "end": { - "line": 23, - "column": 1, - "program": "throwInRethrowingFunction2.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/throwInThrowingFunction-expected.txt b/ets2panda/test/compiler/ets/throwInThrowingFunction-expected.txt deleted file mode 100644 index a677bd13a0d0115eb42be6cbec8093c7d3af0e7b..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/throwInThrowingFunction-expected.txt +++ /dev/null @@ -1,480 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "throwInThrowingFunction.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "throwInThrowingFunction.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 26, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 16, - "column": 30, - "program": "throwInThrowingFunction.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 17, - "column": 22, - "program": "throwInThrowingFunction.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 17, - "column": 23, - "program": "throwInThrowingFunction.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 17, - "column": 23, - "program": "throwInThrowingFunction.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 17, - "column": 9, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "throwInThrowingFunction.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "throwInThrowingFunction.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 38, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwInThrowingFunction.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwInThrowingFunction.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwInThrowingFunction.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwInThrowingFunction.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwInThrowingFunction.ets" - }, - "end": { - "line": 19, - "column": 1, - "program": "throwInThrowingFunction.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/throwingFunctionAsParameter1-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionAsParameter1-expected.txt deleted file mode 100644 index 1b05a374db3c1e40b2f483e642796e69dc3aa168..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/throwingFunctionAsParameter1-expected.txt +++ /dev/null @@ -1,835 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "RethrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 16, - "column": 24, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "RethrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 16, - "column": 24, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "func", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 37, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 16, - "column": 41, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 31, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 16, - "column": 41, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 25, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 16, - "column": 41, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 25, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 16, - "column": 41, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 51, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 16, - "column": 55, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 17, - "column": 7, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 17, - "column": 9, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 17, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 65, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "NonThrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 20, - "column": 25, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "NonThrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 20, - "column": 25, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "func", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 38, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 20, - "column": 42, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 32, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 20, - "column": 42, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 20, - "column": 42, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 20, - "column": 42, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 52, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 20, - "column": 56, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "func", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 22, - "column": 9, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 22, - "column": 11, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 22, - "column": 12, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 7, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 15, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 12, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 23, - "column": 13, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 57, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - }, - "end": { - "line": 25, - "column": 1, - "program": "throwingFunctionAsParameter1.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck2-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck2-expected.txt deleted file mode 100644 index cc12ad55a965cbdff86e12a70b4763982f9ea998..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck2-expected.txt +++ /dev/null @@ -1,809 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 26, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 16, - "column": 30, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 38, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 16, - "column": 40, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 16, - "column": 40, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 16, - "column": 40, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 16, - "column": 40, - "program": "throwingFunctionCheck2.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 18, - "column": 14, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 18, - "column": 14, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 18, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 18, - "column": 22, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 17, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 22, - "column": 29, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 17, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 22, - "column": 31, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 22, - "column": 32, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 17, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 14, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 36, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 38, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 25, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 34, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 25, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 35, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 25, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 35, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 22, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 23, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 15, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 38, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 21, - "column": 13, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 23, - "column": 38, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 13, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 24, - "column": 10, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 24, - "column": 21, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 24, - "column": 23, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 18, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 24, - "column": 19, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 11, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 24, - "column": 23, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 20, - "column": 9, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 24, - "column": 23, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 19, - "column": 9, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 6, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 25, - "column": 28, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 30, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 17, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 26, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 17, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 27, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 17, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 27, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 14, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 15, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 7, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 30, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 25, - "column": 30, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 23, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 26, - "column": 2, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck2.ets" - }, - "end": { - "line": 27, - "column": 1, - "program": "throwingFunctionCheck2.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck3-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck3-expected.txt deleted file mode 100644 index d9f11899d8a68c7752d0369b34b85b99f09e8598..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck3-expected.txt +++ /dev/null @@ -1,1154 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 16, - "column": 16, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 26, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 17, - "column": 16, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 16, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 17, - "column": 28, - "program": "throwingFunctionCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestMethod", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 15, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestMethod", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 15, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 19, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 23, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 24, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 26, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 26, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 26, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 18, - "column": 26, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 21, - "column": 9, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 21, - "column": 9, - "program": "throwingFunctionCheck3.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 21, - "column": 22, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 21, - "column": 22, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 26, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 21, - "column": 30, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 10, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 26, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 27, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 27, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 22, - "column": 13, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 29, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 29, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 22, - "column": 29, - "program": "throwingFunctionCheck3.ets" - } - } - }, - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 25, - "column": 10, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "TestMethod", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 11, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 25, - "column": 21, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 25, - "column": 21, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 25, - "column": 23, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 25, - "column": 24, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 6, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 26, - "column": 28, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 30, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 26, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 27, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 27, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 14, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 15, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 7, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 30, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 24, - "column": 5, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 26, - "column": 30, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 38, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 27, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 21, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 27, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 27, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 27, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 29, - "column": 14, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 29, - "column": 14, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 29, - "column": 18, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 29, - "column": 22, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 31, - "column": 21, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 31, - "column": 23, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 31, - "column": 24, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 9, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 32, - "column": 6, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 32, - "column": 17, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 32, - "column": 19, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 14, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 32, - "column": 15, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 7, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 32, - "column": 19, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 32, - "column": 19, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 23, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 10, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck3.ets" - }, - "end": { - "line": 34, - "column": 1, - "program": "throwingFunctionCheck3.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/throwingFunctionCheck6-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionCheck6-expected.txt deleted file mode 100644 index 767d95af4817b9d2eb576dc977c91bab7a2680c8..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/throwingFunctionCheck6-expected.txt +++ /dev/null @@ -1,1180 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 7, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 20, - "column": 16, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testMethod", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 21, - "column": 13, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testMethod", - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 21, - "column": 13, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 17, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 21, - "column": 21, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 15, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 22, - "column": 24, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 15, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 22, - "column": 25, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 15, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 22, - "column": 25, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 22, - "column": 11, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 22, - "column": 27, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 22, - "column": 27, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 29, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 21, - "column": 13, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 13, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "throwingFunctionCheck6.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 20, - "column": 18, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 17, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 26, - "column": 9, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 26, - "column": 9, - "program": "throwingFunctionCheck6.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 26, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 16, - "column": 30, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 17, - "column": 22, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 17, - "column": 23, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 17, - "column": 23, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 17, - "column": 9, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 38, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 26, - "column": 14, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 26, - "column": 14, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 26, - "column": 18, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 26, - "column": 22, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "testClass", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 7, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 27, - "column": 16, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "init": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 23, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 27, - "column": 32, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 23, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 27, - "column": 33, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 23, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 27, - "column": 33, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 27, - "column": 19, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 27, - "column": 35, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 7, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 27, - "column": 35, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 27, - "column": 3, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 27, - "column": 35, - "program": "throwingFunctionCheck6.ets" - } - } - }, - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "TestFunction", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 30, - "column": 17, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 30, - "column": 19, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 30, - "column": 20, - "program": "throwingFunctionCheck6.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "testClass", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 31, - "column": 14, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "testMethod", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 15, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 31, - "column": 25, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 31, - "column": 25, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 31, - "column": 27, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 31, - "column": 28, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "loc": { - "start": { - "line": 29, - "column": 7, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 32, - "column": 4, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 32, - "column": 15, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 32, - "column": 17, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 32, - "column": 12, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 32, - "column": 13, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 32, - "column": 5, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 32, - "column": 17, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 29, - "column": 3, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 32, - "column": 17, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "loc": { - "start": { - "line": 26, - "column": 23, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 10, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionCheck6.ets" - }, - "end": { - "line": 34, - "column": 1, - "program": "throwingFunctionCheck6.ets" - } - } -} diff --git a/ets2panda/test/compiler/ets/throwingFunctionType1-expected.txt b/ets2panda/test/compiler/ets/throwingFunctionType1-expected.txt deleted file mode 100644 index 123a8379e06381a25eb6cfade032502deeba74c2..0000000000000000000000000000000000000000 --- a/ets2panda/test/compiler/ets/throwingFunctionType1-expected.txt +++ /dev/null @@ -1,654 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "func_type", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 6, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "throwingFunctionType1.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 24, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 16, - "column": 28, - "program": "throwingFunctionType1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 16, - "column": 28, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 16, - "column": 36, - "program": "throwingFunctionType1.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 18, - "column": 14, - "program": "throwingFunctionType1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 18, - "column": 14, - "program": "throwingFunctionType1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 18, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 18, - "column": 22, - "program": "throwingFunctionType1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "func_type", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 19, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 21, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 21, - "program": "throwingFunctionType1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 7, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 8, - "program": "throwingFunctionType1.ets" - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 26, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 30, - "program": "throwingFunctionType1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 34, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 36, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 36, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 36, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 7, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 36, - "program": "throwingFunctionType1.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 19, - "column": 3, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 19, - "column": 37, - "program": "throwingFunctionType1.ets" - } - } - }, - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 22, - "column": 6, - "program": "throwingFunctionType1.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 22, - "column": 8, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 5, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 22, - "column": 9, - "program": "throwingFunctionType1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 21, - "column": 7, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 23, - "column": 4, - "program": "throwingFunctionType1.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 15, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "throwingFunctionType1.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "e", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 12, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 23, - "column": 13, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "throwingFunctionType1.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 23, - "column": 17, - "program": "throwingFunctionType1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 23, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionType1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 24, - "column": 2, - "program": "throwingFunctionType1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwingFunctionType1.ets" - }, - "end": { - "line": 25, - "column": 1, - "program": "throwingFunctionType1.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/constructorThrowsRethrows-expected.txt b/ets2panda/test/parser/ets/constructorThrowsRethrows-expected.txt deleted file mode 100644 index b4ef5220f5a6739752c6c660301c1e8f94f76ee9..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/constructorThrowsRethrows-expected.txt +++ /dev/null @@ -1,753 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 16, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 24, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 26, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 26, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 14, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 26, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 26, - "program": "constructorThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 6, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 6, - "program": "constructorThrowsRethrows.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TestClassToo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 7, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 19, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "constructor", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 26, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 29, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 23, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 29, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 23, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 29, - "program": "constructorThrowsRethrows.ets" - } - } - }, - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 34, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 37, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 31, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 37, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 31, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 37, - "program": "constructorThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 21, - "column": 42, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 46, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 21, - "column": 22, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 46, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 15, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 46, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 15, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 46, - "program": "constructorThrowsRethrows.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 21, - "column": 64, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 66, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 21, - "column": 14, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 66, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 21, - "column": 14, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 66, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 21, - "column": 3, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 66, - "program": "constructorThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 20, - "column": 20, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 23, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 23, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "constructorThrowsRethrows.ets" - }, - "end": { - "line": 23, - "column": 1, - "program": "constructorThrowsRethrows.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/functionThrowsRethrows-expected.txt b/ets2panda/test/parser/ets/functionThrowsRethrows-expected.txt deleted file mode 100644 index 4d1c381ee196904ffc6c398171ceefcef08d1fd3..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/functionThrowsRethrows-expected.txt +++ /dev/null @@ -1,809 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "functionThrowsRethrows.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testFunction", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "functionThrowsRethrows.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 26, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 30, - "program": "functionThrowsRethrows.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ThrowStatement", - "argument": { - "type": "ETSNewClassInstanceExpression", - "typeReference": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "Exception", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 24, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 15, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "functionThrowsRethrows.ets" - } - } - }, - "arguments": [], - "loc": { - "start": { - "line": 17, - "column": 11, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 27, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 27, - "program": "functionThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 38, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "functionThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "functionThrowsRethrows.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 2, - "program": "functionThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testFunctionToo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 25, - "program": "functionThrowsRethrows.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testFunctionToo", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 25, - "program": "functionThrowsRethrows.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 37, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "functionThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 34, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 34, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 40, - "program": "functionThrowsRethrows.ets" - } - } - }, - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 45, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 48, - "program": "functionThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 42, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 48, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 42, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 48, - "program": "functionThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 53, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 57, - "program": "functionThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 33, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 57, - "program": "functionThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 26, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 57, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 26, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 57, - "program": "functionThrowsRethrows.ets" - } - } - }, - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "p", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 69, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 72, - "program": "functionThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 66, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 72, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 66, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 72, - "program": "functionThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 75, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 79, - "program": "functionThrowsRethrows.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 89, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 91, - "program": "functionThrowsRethrows.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 91, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 91, - "program": "functionThrowsRethrows.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 20, - "column": 91, - "program": "functionThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 1, - "program": "functionThrowsRethrows.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/functionTypeThrows-expected.txt b/ets2panda/test/parser/ets/functionTypeThrows-expected.txt deleted file mode 100644 index 072678965d159e3c7cb183f89f02cf44640dfa82..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/functionTypeThrows-expected.txt +++ /dev/null @@ -1,446 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 6, - "program": "functionTypeThrows.ets" - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 12, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "functionTypeThrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "functionTypeThrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 9, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "functionTypeThrows.ets" - } - } - }, - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 20, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 23, - "program": "functionTypeThrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 23, - "program": "functionTypeThrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 23, - "program": "functionTypeThrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 28, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 32, - "program": "functionTypeThrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 8, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 32, - "program": "functionTypeThrows.ets" - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 16, - "column": 6, - "program": "functionTypeThrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "functionTypeThrows.ets" - }, - "end": { - "line": 17, - "column": 1, - "program": "functionTypeThrows.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/lambdaThrowsRethrows-expected.txt b/ets2panda/test/parser/ets/lambdaThrowsRethrows-expected.txt deleted file mode 100644 index dc195cfcfabbf3bd8547764c2145eadd08ebe09a..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/lambdaThrowsRethrows-expected.txt +++ /dev/null @@ -1,974 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "lambda", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 11, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "right": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 37, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 41, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 52, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 54, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 33, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 54, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 33, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 54, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 54, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 54, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "lambda2", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 12, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "right": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 84, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 87, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 81, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 87, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 81, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 87, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 92, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 95, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 89, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 95, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 89, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 95, - "program": "lambdaThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 100, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 104, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 18, - "column": 80, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 104, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 73, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 104, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 73, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 104, - "program": "lambdaThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 114, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 118, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 131, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 133, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 18, - "column": 72, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 133, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 72, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 133, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 133, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 133, - "program": "lambdaThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "lambda", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 11, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 19, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 23, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 13, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 23, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 54, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "lambda2", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 12, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 26, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 29, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 23, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 29, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 23, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 29, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 34, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 37, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 31, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 37, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 31, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 37, - "program": "lambdaThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 42, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 46, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 18, - "column": 22, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 46, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 15, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 46, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 15, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 46, - "program": "lambdaThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 58, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 62, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 18, - "column": 14, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 62, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 18, - "column": 133, - "program": "lambdaThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 1, - "program": "lambdaThrowsRethrows.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/methodThrowsRethrows-expected.txt b/ets2panda/test/parser/ets/methodThrowsRethrows-expected.txt deleted file mode 100644 index 093b36752fb1dddc242b9b574c380e5684156512..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/methodThrowsRethrows-expected.txt +++ /dev/null @@ -1,838 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "TestClass", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 7, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 16, - "program": "methodThrowsRethrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testMethodThrows", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 19, - "program": "methodThrowsRethrows.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testMethodThrows", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 19, - "program": "methodThrowsRethrows.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 23, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 27, - "program": "methodThrowsRethrows.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 17, - "column": 35, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 37, - "program": "methodThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 17, - "column": 19, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 37, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 19, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 37, - "program": "methodThrowsRethrows.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 3, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 17, - "column": 37, - "program": "methodThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testMethodRethrows", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 3, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 21, - "program": "methodThrowsRethrows.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testMethodRethrows", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 3, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 21, - "program": "methodThrowsRethrows.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 33, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 36, - "program": "methodThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 30, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 36, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 30, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 36, - "program": "methodThrowsRethrows.ets" - } - } - }, - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "b", - "typeAnnotation": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 41, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 44, - "program": "methodThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 38, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 44, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 38, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 44, - "program": "methodThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 49, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 53, - "program": "methodThrowsRethrows.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 19, - "column": 29, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 53, - "program": "methodThrowsRethrows.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 22, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 53, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 22, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 53, - "program": "methodThrowsRethrows.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 63, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 67, - "program": "methodThrowsRethrows.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 77, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 79, - "program": "methodThrowsRethrows.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 19, - "column": 21, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 79, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 21, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 79, - "program": "methodThrowsRethrows.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 3, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 19, - "column": 79, - "program": "methodThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 16, - "column": 18, - "program": "methodThrowsRethrows.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "methodThrowsRethrows.ets" - }, - "end": { - "line": 21, - "column": 1, - "program": "methodThrowsRethrows.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/method_override_throw_1-expected.txt b/ets2panda/test/parser/ets/method_override_throw_1-expected.txt deleted file mode 100644 index c04044c9c42e678415143413d4c2418d4a548f15..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/method_override_throw_1-expected.txt +++ /dev/null @@ -1,2575 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSInterfaceDeclaration", - "body": { - "type": "TSInterfaceBody", - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 17, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 17, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 17, - "column": 13, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 17, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 17, - "column": 25, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 23, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 18, - "column": 17, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 37, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 41, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 18, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 41, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 41, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 18, - "column": 51, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 19, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 19, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 13, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 19, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 19, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 19, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 19, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 16, - "column": 13, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 20, - "column": 2, - "program": "method_override_throw_1.ets" - } - } - }, - "id": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 11, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 16, - "column": 12, - "program": "method_override_throw_1.ets" - } - } - }, - "extends": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 6, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "AClass", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 7, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 13, - "program": "method_override_throw_1.ets" - } - } - }, - "superClass": null, - "implements": [ - { - "type": "TSClassImplements", - "expression": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "A", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 25, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 26, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 25, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - } - ], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 23, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 23, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 23, - "column": 22, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 23, - "column": 26, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 23, - "column": 34, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 23, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 23, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 23, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 23, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 23, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 24, - "column": 32, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 24, - "column": 26, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 19, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 19, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 24, - "column": 46, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 50, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 24, - "column": 60, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 24, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 24, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 25, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 25, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 25, - "column": 22, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 25, - "column": 26, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 25, - "column": 27, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 25, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 25, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 25, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 25, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 22, - "column": 28, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 27, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 6, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 6, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "BClass", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 7, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 13, - "program": "method_override_throw_1.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 29, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 29, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 29, - "column": 13, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 29, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 29, - "column": 25, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 29, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 29, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 29, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 29, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 29, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 30, - "column": 23, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 30, - "column": 17, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 10, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 10, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 27, - "program": "method_override_throw_1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 30, - "column": 37, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 41, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 30, - "column": 51, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 53, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 30, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 53, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 53, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 30, - "column": 53, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 31, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 31, - "column": 9, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 31, - "column": 13, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 31, - "column": 17, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 31, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 31, - "column": 20, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 31, - "column": 20, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 31, - "column": 20, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 31, - "column": 20, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 28, - "column": 15, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 6, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 28, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 6, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "CClass", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 13, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 19, - "program": "method_override_throw_1.ets" - } - } - }, - "superClass": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "BClass", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 34, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 28, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 35, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo1", - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 35, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 35, - "column": 22, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 35, - "column": 26, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 35, - "column": 34, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 35, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 35, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 35, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 35, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 35, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 35, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 35, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "param", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 36, - "column": 32, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 36, - "column": 26, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 19, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 19, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 36, - "column": 46, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 50, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 36, - "column": 60, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 36, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 36, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 36, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 36, - "column": 62, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 37, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo3", - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 14, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 37, - "column": 18, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 37, - "column": 22, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 37, - "column": 26, - "program": "method_override_throw_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 37, - "column": 27, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 37, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 37, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 37, - "column": 18, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 37, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 37, - "column": 5, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 37, - "column": 29, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "kind": "constructor", - "static": false, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "constructor", - "decorators": [], - "loc": { - "start": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 34, - "column": 36, - "program": "method_override_throw_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - } - ], - "loc": { - "start": { - "line": 34, - "column": 35, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 39, - "column": 1, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 34, - "column": 7, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 39, - "column": 1, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "method_override_throw_1.ets" - }, - "end": { - "line": 39, - "column": 1, - "program": "method_override_throw_1.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/rethrow-func-1-expected.txt b/ets2panda/test/parser/ets/rethrow-func-1-expected.txt deleted file mode 100644 index 76388e85f7e856dc52a03f3696a340312cb9c9d7..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/rethrow-func-1-expected.txt +++ /dev/null @@ -1,1309 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "TSTypeAliasDeclaration", - "id": { - "type": "Identifier", - "name": "func_type", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 6, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "rethrow-func-1.ets" - } - } - }, - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 24, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 16, - "column": 28, - "program": "rethrow-func-1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 16, - "column": 28, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 16, - "column": 36, - "program": "rethrow-func-1.ets" - } - } - }, - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "RethrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 18, - "column": 24, - "program": "rethrow-func-1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "RethrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 18, - "column": 24, - "program": "rethrow-func-1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "f121f", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "func_type", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 32, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 18, - "column": 41, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 18, - "column": 42, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 32, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 18, - "column": 42, - "program": "rethrow-func-1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 25, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 18, - "column": 42, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 25, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 18, - "column": 42, - "program": "rethrow-func-1.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "console", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 19, - "column": 12, - "program": "rethrow-func-1.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "println", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 13, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 19, - "column": 20, - "program": "rethrow-func-1.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 19, - "column": 20, - "program": "rethrow-func-1.ets" - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "Hello in RethrowingFunc", - "loc": { - "start": { - "line": 19, - "column": 21, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 19, - "column": 46, - "program": "rethrow-func-1.ets" - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 19, - "column": 47, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 19, - "column": 47, - "program": "rethrow-func-1.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "f121f", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 20, - "column": 10, - "program": "rethrow-func-1.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 20, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 20, - "column": 12, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 20, - "column": 12, - "program": "rethrow-func-1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 18, - "column": 52, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 21, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 21, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 21, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 21, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 23, - "column": 14, - "program": "rethrow-func-1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 23, - "column": 14, - "program": "rethrow-func-1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 23, - "column": 18, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 23, - "column": 22, - "program": "rethrow-func-1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "my_var", - "typeAnnotation": { - "type": "ETSTypeReference", - "part": { - "type": "ETSTypeReferencePart", - "name": { - "type": "Identifier", - "name": "func_type", - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 24, - "column": 26, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 24, - "column": 28, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 24, - "column": 28, - "program": "rethrow-func-1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 24, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 24, - "column": 15, - "program": "rethrow-func-1.ets" - } - } - }, - "init": { - "type": "ArrowFunctionExpression", - "function": { - "type": "ScriptFunction", - "id": null, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 24, - "column": 33, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 24, - "column": 37, - "program": "rethrow-func-1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "console", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 25, - "column": 16, - "program": "rethrow-func-1.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "println", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 25, - "column": 24, - "program": "rethrow-func-1.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 25, - "column": 24, - "program": "rethrow-func-1.ets" - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "Hello in my_var", - "loc": { - "start": { - "line": 25, - "column": 25, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 25, - "column": 42, - "program": "rethrow-func-1.ets" - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 25, - "column": 43, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 25, - "column": 43, - "program": "rethrow-func-1.ets" - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 26, - "column": 13, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 26, - "column": 14, - "program": "rethrow-func-1.ets" - } - } - }, - "init": { - "type": "BinaryExpression", - "operator": "/", - "left": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 26, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 26, - "column": 18, - "program": "rethrow-func-1.ets" - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 0, - "loc": { - "start": { - "line": 26, - "column": 21, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 26, - "column": 22, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 26, - "column": 22, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 26, - "column": 13, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 26, - "column": 22, - "program": "rethrow-func-1.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 26, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 26, - "column": 22, - "program": "rethrow-func-1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 24, - "column": 41, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 27, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 29, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 27, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 29, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 27, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 24, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 27, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 24, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 27, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - }, - { - "type": "TryStatement", - "block": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "RethrowingFunc", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 29, - "column": 23, - "program": "rethrow-func-1.ets" - } - } - }, - "arguments": [ - { - "type": "Identifier", - "name": "my_var", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 24, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 29, - "column": 30, - "program": "rethrow-func-1.ets" - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 29, - "column": 31, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 29, - "column": 32, - "program": "rethrow-func-1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 28, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 30, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - }, - "handler": [ - { - "type": "CatchClause", - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "MemberExpression", - "object": { - "type": "Identifier", - "name": "console", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 31, - "column": 16, - "program": "rethrow-func-1.ets" - } - } - }, - "property": { - "type": "Identifier", - "name": "println", - "decorators": [], - "loc": { - "start": { - "line": 31, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 31, - "column": 24, - "program": "rethrow-func-1.ets" - } - } - }, - "computed": false, - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 31, - "column": 24, - "program": "rethrow-func-1.ets" - } - } - }, - "arguments": [ - { - "type": "StringLiteral", - "value": "Hello in exception", - "loc": { - "start": { - "line": 31, - "column": 25, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 31, - "column": 45, - "program": "rethrow-func-1.ets" - } - } - } - ], - "optional": false, - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 31, - "column": 46, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 31, - "column": 9, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 31, - "column": 46, - "program": "rethrow-func-1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 30, - "column": 17, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 32, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - }, - "param": { - "type": "Identifier", - "name": "a", - "decorators": [], - "loc": { - "start": { - "line": 30, - "column": 14, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 30, - "column": 15, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 30, - "column": 7, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 32, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - } - ], - "finalizer": null, - "loc": { - "start": { - "line": 28, - "column": 5, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 32, - "column": 6, - "program": "rethrow-func-1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 23, - "column": 23, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 10, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 33, - "column": 2, - "program": "rethrow-func-1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "rethrow-func-1.ets" - }, - "end": { - "line": 34, - "column": 1, - "program": "rethrow-func-1.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/throwsRethrowsAsVariables-expected.txt b/ets2panda/test/parser/ets/throwsRethrowsAsVariables-expected.txt deleted file mode 100644 index 3e02fd2143b2ad178d1dfefce275728aafe998bd..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/throwsRethrowsAsVariables-expected.txt +++ /dev/null @@ -1,829 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "throws", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 16, - "column": 11, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 16, - "column": 14, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "AssignmentExpression", - "operator": "=", - "left": { - "type": "Identifier", - "name": "rethrows", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 17, - "column": 13, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "right": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 16, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "throwsRethrowsAsVariables.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "throws", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 16, - "column": 11, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 1, - "loc": { - "start": { - "line": 16, - "column": 14, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 16, - "column": 15, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - { - "type": "ClassProperty", - "key": { - "type": "Identifier", - "name": "rethrows", - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 17, - "column": 13, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "value": { - "type": "NumberLiteral", - "value": 2, - "loc": { - "start": { - "line": 17, - "column": 16, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "accessibility": "public", - "static": true, - "readonly": false, - "declare": false, - "optional": false, - "computed": false, - "definite": false, - "decorators": [], - "loc": { - "start": { - "line": 17, - "column": 5, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 17, - "column": 17, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testFunction", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 19, - "column": 22, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testFunction", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 19, - "column": 22, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 26, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 19, - "column": 30, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 38, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 19, - "column": 40, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 19, - "column": 40, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 19, - "column": 40, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 19, - "column": 40, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "testFunction2", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 23, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "testFunction2", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 23, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "f", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 33, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 37, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 27, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 37, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 24, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 37, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 24, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 37, - "program": "throwsRethrowsAsVariables.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 47, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 51, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 61, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 63, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 63, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 63, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 20, - "column": 63, - "program": "throwsRethrowsAsVariables.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - }, - "end": { - "line": 21, - "column": 1, - "program": "throwsRethrowsAsVariables.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_with_throw-expected.txt b/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_with_throw-expected.txt deleted file mode 100644 index edeeb7a5946c23d7a08b718ab57245f78afc2d01..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/trailing_lambda_tests/trailing_lambda_with_throw-expected.txt +++ /dev/null @@ -1,817 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 16, - "column": 13, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 16, - "column": 13, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 21, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 16, - "column": 17, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 14, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 14, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "trailing_lambda_with_throw.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 34, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 17, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 17, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 17, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 17, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 19, - "column": 14, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 19, - "column": 14, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "c", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 19, - "column": 22, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 19, - "column": 26, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 18, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 19, - "column": 26, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 15, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 19, - "column": 26, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 15, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 19, - "column": 26, - "program": "trailing_lambda_with_throw.ets" - } - } - } - ], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 19, - "column": 28, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 20, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 20, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 19, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 20, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 19, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 20, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 23, - "column": 8, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 23, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 23, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 27, - "column": 8, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 27, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 27, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 27, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 29, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 29, - "column": 9, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 29, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 29, - "column": 11, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 29, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 29, - "column": 11, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - { - "type": "ExpressionStatement", - "expression": { - "type": "CallExpression", - "callee": { - "type": "Identifier", - "name": "foo2", - "decorators": [], - "loc": { - "start": { - "line": 33, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 33, - "column": 9, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "arguments": [], - "optional": false, - "loc": { - "start": { - "line": 33, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 33, - "column": 11, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 33, - "column": 5, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 33, - "column": 11, - "program": "trailing_lambda_with_throw.ets" - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 17, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 34, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 34, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 34, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 34, - "column": 2, - "program": "trailing_lambda_with_throw.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - }, - "end": { - "line": 35, - "column": 1, - "program": "trailing_lambda_with_throw.ets" - } - } -} diff --git a/ets2panda/test/parser/ets/variable_throw_function_1-expected.txt b/ets2panda/test/parser/ets/variable_throw_function_1-expected.txt deleted file mode 100644 index 68ebafcd7a72a8821b984bc038f07af4a6a73229..0000000000000000000000000000000000000000 --- a/ets2panda/test/parser/ets/variable_throw_function_1-expected.txt +++ /dev/null @@ -1,1087 +0,0 @@ -{ - "type": "Program", - "statements": [ - { - "type": "ClassDeclaration", - "definition": { - "id": { - "type": "Identifier", - "name": "ETSGLOBAL", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - } - } - }, - "superClass": null, - "implements": [], - "body": [ - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "_$init$_", - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": null - }, - "end": { - "line": 1, - "column": 1, - "program": null - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 16, - "column": 13, - "program": "variable_throw_function_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 16, - "column": 13, - "program": "variable_throw_function_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 16, - "column": 18, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 16, - "column": 22, - "program": "variable_throw_function_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 16, - "column": 23, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 16, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "variable_throw_function_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 16, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 16, - "column": 25, - "program": "variable_throw_function_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 18, - "column": 13, - "program": "variable_throw_function_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 18, - "column": 13, - "program": "variable_throw_function_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 18, - "column": 18, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 18, - "column": 22, - "program": "variable_throw_function_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 18, - "column": 30, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 18, - "column": 32, - "program": "variable_throw_function_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 18, - "column": 32, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 18, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 18, - "column": 32, - "program": "variable_throw_function_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 18, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 18, - "column": 32, - "program": "variable_throw_function_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 13, - "program": "variable_throw_function_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 13, - "program": "variable_throw_function_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 23, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "variable_throw_function_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 20, - "column": 17, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "variable_throw_function_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 14, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 14, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 27, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 20, - "column": 38, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 42, - "program": "variable_throw_function_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [], - "loc": { - "start": { - "line": 20, - "column": 52, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 54, - "program": "variable_throw_function_1.ets" - } - } - }, - "throwMarker": "rethrows", - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 54, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 20, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 54, - "program": "variable_throw_function_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 20, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 20, - "column": 54, - "program": "variable_throw_function_1.ets" - } - } - }, - { - "type": "MethodDefinition", - "key": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "variable_throw_function_1.ets" - } - } - }, - "kind": "method", - "accessibility": "public", - "static": true, - "optional": false, - "computed": false, - "value": { - "type": "FunctionExpression", - "function": { - "type": "ScriptFunction", - "id": { - "type": "Identifier", - "name": "main", - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 22, - "column": 14, - "program": "variable_throw_function_1.ets" - } - } - }, - "generator": false, - "async": false, - "expression": false, - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 22, - "column": 18, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 22, - "column": 22, - "program": "variable_throw_function_1.ets" - } - } - }, - "body": { - "type": "BlockStatement", - "statements": [ - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "throwing1", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 23, - "column": 26, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 23, - "column": 30, - "program": "variable_throw_function_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 23, - "column": 20, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 23, - "column": 30, - "program": "variable_throw_function_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 9, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 23, - "column": 18, - "program": "variable_throw_function_1.ets" - } - } - }, - "init": { - "type": "Identifier", - "name": "foo", - "decorators": [], - "loc": { - "start": { - "line": 23, - "column": 40, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 23, - "column": 43, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 23, - "column": 9, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 23, - "column": 43, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 23, - "column": 5, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 23, - "column": 44, - "program": "variable_throw_function_1.ets" - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "throwing2", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 25, - "column": 26, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 25, - "column": 30, - "program": "variable_throw_function_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 25, - "column": 20, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 25, - "column": 30, - "program": "variable_throw_function_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 25, - "column": 18, - "program": "variable_throw_function_1.ets" - } - } - }, - "init": { - "type": "Identifier", - "name": "bar", - "decorators": [], - "loc": { - "start": { - "line": 25, - "column": 40, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 25, - "column": 43, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 25, - "column": 9, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 25, - "column": 43, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 25, - "column": 5, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 25, - "column": 44, - "program": "variable_throw_function_1.ets" - } - } - }, - { - "type": "VariableDeclaration", - "declarations": [ - { - "type": "VariableDeclarator", - "id": { - "type": "Identifier", - "name": "throwing3", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [ - { - "type": "ETSParameterExpression", - "name": { - "type": "Identifier", - "name": "e", - "typeAnnotation": { - "type": "ETSFunctionType", - "params": [], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 27, - "column": 30, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 34, - "program": "variable_throw_function_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 27, - "column": 24, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 34, - "program": "variable_throw_function_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 21, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 34, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 21, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 34, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "returnType": { - "type": "ETSPrimitiveType", - "loc": { - "start": { - "line": 27, - "column": 46, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 50, - "program": "variable_throw_function_1.ets" - } - } - }, - "throwMarker": "throws", - "loc": { - "start": { - "line": 27, - "column": 20, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 50, - "program": "variable_throw_function_1.ets" - } - } - }, - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 9, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 18, - "program": "variable_throw_function_1.ets" - } - } - }, - "init": { - "type": "Identifier", - "name": "baz", - "decorators": [], - "loc": { - "start": { - "line": 27, - "column": 60, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 63, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 27, - "column": 9, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 63, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "kind": "let", - "loc": { - "start": { - "line": 27, - "column": 5, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 27, - "column": 64, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 22, - "column": 23, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 22, - "column": 10, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "variable_throw_function_1.ets" - } - } - }, - "overloads": [], - "decorators": [], - "loc": { - "start": { - "line": 22, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 28, - "column": 2, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - } - } - }, - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - } - } - } - ], - "loc": { - "start": { - "line": 1, - "column": 1, - "program": "variable_throw_function_1.ets" - }, - "end": { - "line": 29, - "column": 1, - "program": "variable_throw_function_1.ets" - } - } -} diff --git a/ets2panda/test/runtime/ets/UnaryExpression.ets b/ets2panda/test/runtime/ets/UnaryExpression.ets index b08df62db47c788d52fc95e79aad9489c526dba7..2502dbb53d0425191bc1f7813a0e6ad5cb33f6a3 100644 --- a/ets2panda/test/runtime/ets/UnaryExpression.ets +++ b/ets2panda/test/runtime/ets/UnaryExpression.ets @@ -117,24 +117,4 @@ function main(): void { let f = + -1; arktest.assertEQ(f, -1); } - - { - let a = -(-1); - assertEQ(a, 1); - - let b = -(1); - assertEQ(b, -1); - - let c = - -1; - assertEQ(c, 1); - - let d = +(1); - assertEQ(d, 1); - - let e = +(-1); - assertEQ(e, -1); - - let f = + -1; - assertEQ(f, -1); - } } diff --git a/ets2panda/test/unit/plugin/use_plugin_to_test_export_table.cpp b/ets2panda/test/unit/plugin/use_plugin_to_test_export_table.cpp deleted file mode 100644 index 1bfb5a30effa8c3c2fcb7d418bc7b2b046e4f4c1..0000000000000000000000000000000000000000 --- a/ets2panda/test/unit/plugin/use_plugin_to_test_export_table.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/** - * Copyright (c) 2025 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. - */ - -#include -#include -#include "file.h" -#include "macros.h" -#include "os/file.h" -#include "public/es2panda_lib.h" -#include "util.h" -#include "parser/program/program.h" -#include "ir/statements/blockStatement.h" -#include "ir/astNode.h" -#include "ir/statements/classDeclaration.h" -#include "ir/base/classDefinition.h" -#include "ir/base/methodDefinition.h" -#include "public/public.h" -#include "util/options.h" -#include "abc2program/abc2program_driver.h" - -// NOLINTBEGIN - -static es2panda_Impl *impl = nullptr; - -namespace { -constexpr size_t CLASS_DEFINITION_INDEX = 1; -constexpr size_t METHOD_DEFINITION_INDEX = 0; -constexpr size_t METHOD_BODY_INDEX = 2; - -enum Const { - LITERAL_INDEX_0 = 0, - LITERAL_INDEX_1 = 1, - LITERAL_INDEX_2 = 2, - LITERAL_INDEX_3 = 3, - LITERAL_INDEX_4 = 4, - LITERAL_INDEX_5 = 5, - EXPECTED_VALUE_1 = 1, - EXPECTED_VALUE_2 = 2, -}; - -const std::string SOURCE_CODE = - " function foo():void {\n" - " }\n" - " class A{}\n"; - -const std::string EXPECTED_CLASS_DEFINITION = "class A {\n public constructor() {}\n \n}\n"; - -const std::string EXPECTED_METHOD_DEFINITION = "function foo(): void {}\n"; - -int CheckLiteralValues(ark::es2panda::public_lib::Context *ctx, const ark::pandasm::Program &prog) -{ - auto file = ark::panda_file::OpenPandaFile(ctx->config->options->GetOutput()); - if (!file) { - return TEST_ERROR_CODE; - } - - auto literalArrIt = prog.literalarrayTable.find("0"); - if (literalArrIt == prog.literalarrayTable.end()) { - return TEST_ERROR_CODE; - } - auto &literalArr = literalArrIt->second.literals; - if (EXPECTED_VALUE_2 != std::get(literalArr[LITERAL_INDEX_1].value) || - EXPECTED_VALUE_1 != std::get(literalArr[LITERAL_INDEX_4].value)) { - return TEST_ERROR_CODE; - } - - const auto offsetA = std::get(literalArr[LITERAL_INDEX_0].value); - const auto stringDataA = file->GetStringData(ark::panda_file::File::EntityId(offsetA)); - auto stringA = std::string(reinterpret_cast(stringDataA.data), stringDataA.utf16Length); - - const auto offsetFoo = std::get(literalArr[LITERAL_INDEX_3].value); - const auto stringDataFoo = file->GetStringData(ark::panda_file::File::EntityId(offsetFoo)); - auto stringFoo = std::string(reinterpret_cast(stringDataFoo.data), stringDataFoo.utf16Length); - - if (stringA != EXPECTED_CLASS_DEFINITION) { - return TEST_ERROR_CODE; - } - - if (stringFoo != EXPECTED_METHOD_DEFINITION) { - return TEST_ERROR_CODE; - } - - return 0; -} - -void ProcessProgram(ark::es2panda::parser::Program *programPtr) -{ - auto *classDef = programPtr->Ast()->Statements()[CLASS_DEFINITION_INDEX]->AsClassDeclaration()->Definition(); - programPtr->AddDeclGenExportNode(classDef->DumpEtsSrc(), classDef); - - auto *methodDef = programPtr->Ast() - ->Statements()[METHOD_DEFINITION_INDEX] - ->AsClassDeclaration() - ->Definition() - ->AsClassDefinition() - ->Body()[METHOD_BODY_INDEX] - ->AsMethodDefinition(); - programPtr->AddDeclGenExportNode(methodDef->DumpEtsSrc(), methodDef); -} -} // namespace - -int main(int argc, char **argv) -{ - if (argc < MIN_ARGC) { - return INVALID_ARGC_ERROR_CODE; - } - - if (GetImpl() == nullptr) { - return NULLPTR_IMPL_ERROR_CODE; - } - impl = GetImpl(); - const char **args = const_cast(&(argv[1])); - auto config = impl->CreateConfig(argc - 1, args); - auto config_ = reinterpret_cast(config); - const_cast(config_->options)->SetWithExportTable(true); - auto context = impl->CreateContextFromString(config, SOURCE_CODE.data(), argv[argc - 1]); - if (context == nullptr) { - return NULLPTR_CONTEXT_ERROR_CODE; - } - - impl->ProceedToState(context, ES2PANDA_STATE_PARSED); - CheckForErrors("PARSE", context); - - impl->ProceedToState(context, ES2PANDA_STATE_BOUND); - CheckForErrors("BOUND", context); - - impl->ProceedToState(context, ES2PANDA_STATE_CHECKED); - CheckForErrors("CHECKED", context); - - auto program = impl->ContextProgram(context); - auto programPtr = reinterpret_cast(program); - ProcessProgram(programPtr); - - impl->ProceedToState(context, ES2PANDA_STATE_LOWERED); - CheckForErrors("LOWERED", context); - - impl->ProceedToState(context, ES2PANDA_STATE_ASM_GENERATED); - CheckForErrors("ASM", context); - - impl->ProceedToState(context, ES2PANDA_STATE_BIN_GENERATED); - CheckForErrors("BIN", context); - - auto *ctx = reinterpret_cast(context); - auto abc2program = new ark::abc2program::Abc2ProgramDriver(); - abc2program->Compile("./use_plugin_to_test_export_table.abc"); - auto res = CheckLiteralValues(ctx, abc2program->GetProgram()); - impl->DestroyConfig(config); - return res; -} - -// NOLINTEND \ No newline at end of file