| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/03.types/19.union_types/03.keyof_types/ |
| D | keyof_class.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 {% for type in types %} 17 {% for case in cases %} 19 /*--- 20 desc: >- 21 The keyword keyof is applied to the class or interface type (see Classes and Interfaces). 22 …The resultant new type is a union of names (as string literal types) of all accessible members of … 23 tags: [{{case.tags}}] 24 ---*/ 26 {{case.decl}} [all …]
|
| D | keyof_interface.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 {% for case in cases %} 18 /*--- 19 desc: >- 20 The keyword keyof is applied to the class or interface type (see Classes and Interfaces). 21 …The resultant new type is a union of names (as string literal types) of all accessible members of … 22 ---*/ 24 {{case.decl}} 27 {{case.def}} 31 type t = keyof I [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/03.types/19.union_types/ |
| D | union_type_error_assignment.params.yaml | 6 # http://www.apache.org/licenses/LICENSE-2.0 15 - desc: Union type exception assignment. 16 dec1: |- 17 type StringOrNumber = string | number; 19 check: |- 22 - desc: Union type exception assignment(array). 23 dec1: |- 24 type StringOrNumber = string | number; 26 check: |- 29 - desc: Union type exception assignment(Literal type out of bounds). [all …]
|
| D | union_type_assignment.params.yaml | 6 # http://www.apache.org/licenses/LICENSE-2.0 15 - desc: Basic union type. 16 dec1: |- 17 type StringOrNumber = string | number; 19 check: |- 23 - desc: Basic union type(number - int). 24 dec1: |- 25 type StringOrNumber = string | number; 27 check: |- 31 - desc: Basic union type(number calculation). [all …]
|
| /arkcompiler/ets_frontend/ets2panda/checker/ |
| D | TSAnalyzer.cpp | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 29 checker::Type *TSAnalyzer::Check(ir::CatchClause *st) const in Check() function in ark::es2panda::checker::TSAnalyzer 32 ir::Expression *typeAnnotation = st->Param()->AsAnnotatedExpression()->TypeAnnotation(); in Check() 35 checker::Type *catchParamType = typeAnnotation->Check(checker); in Check() 37 if (!catchParamType->HasTypeFlag(checker::TypeFlag::ANY_OR_UNKNOWN)) { in Check() 38 …checker->ThrowTypeError("Catch clause variable type annotation must be 'any' or 'unknown' if speci… in Check() 39 st->Start()); in Check() 43 st->Body()->Check(checker); in Check() 48 checker::Type *TSAnalyzer::Check([[maybe_unused]] ir::ClassDefinition *node) const in Check() function in ark::es2panda::checker::TSAnalyzer [all …]
|
| /arkcompiler/runtime_core/tests/cts-generator/cts-template/ |
| D | test-schema.json | 2 "type": "object", string 4 "file-name", 10 "file-name": { 11 "type": "string" string 14 "type": "boolean" string 17 "type": "boolean" string 20 "type": "object", string 28 "type": "string" string 31 "type": "string" string 34 "type": "array", string [all …]
|
| D | monitor.yaml | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 14 --- 16 - name: PandaAssembly 68 - file-name: 'monitor' 79 … that case monitor is acquired by thread and monitor count is set to 1. The thread becomes the 88 - file-name: 'null_monitor' 89 description: Check panda.NullPointerException when accumulator contains null 92 - sig: monitorenter 97 - sig: monitorexit [all …]
|
| D | jmp.yaml | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 16 - file-name: "jmp" 23 - branch_target 25 - x_none 27 - file-name: "op_none" 30 - sig: jmp imm:i32 33 … description: Check execution is transferred, jump forward, backward, jump on current instruction. 34 code-template: | 37 check-type: exit-positive [all …]
|
| /arkcompiler/runtime_core/static_core/tests/cts-generator/cts-template/ |
| D | test-schema.json | 2 "type": "object", string 4 "file-name", 10 "file-name": { 11 "type": "string" string 14 "type": "boolean" string 17 "type": "boolean" string 20 "type": "object", string 28 "type": "string" string 31 "type": "string" string 34 "type": "array", string [all …]
|
| D | jmp.yaml | 1 # Copyright (c) 2021-2024 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 16 - file-name: "jmp" 23 - branch_target 25 - x_none 27 - file-name: "op_none" 30 - sig: jmp imm:i32 33 … description: Check execution is transferred, jump forward, backward, jump on current instruction. 34 code-template: | 37 check-type: exit-positive [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/Array/LastIndexOf/ |
| D | builtinArrayLastIndexOf.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 81 print('---- Case group #1: int[] ----') //: ---- Case group #1: int[] ---- 83 print('case 1.1: ', literalIntArrayWithHole.lastIndexOf(4)) //: case 1.1: 4 87 'case 1.2: ', 89 ) //: case 1.2: 4 93 'case 1.3: ', 95 ) //: case 1.3: 2 97 print('case 1.4: ', nIntArray.lastIndexOf(4)) //: case 1.4: 4 99 print('case 1.5: ', literalIntArrayWithHole.lastIndexOf(undefined)) //: case 1.5: -1 101 print('case 1.6: ', nIntArray.lastIndexOf(nIntArray.length)) //: case 1.6: -1 [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/05.generics/generic_declarations/generic_classes/test_bridge_methods_in_generic_overrides/ |
| D | bridge_methods_generic.params.yaml | 6 # http://www.apache.org/licenses/LICENSE-2.0 15 # case 0 16 …- desc: Test that a generic subclass correctly overrides a method from a generic parent class when… 17 dec1: |- 28 check: |- 32 # case 1 33 …- desc: Test generic class inheritance with constructor parameters and method access from both par… 34 dec1: |- 55 check: |- 60 # case 2 [all …]
|
| /arkcompiler/ets_frontend/es2panda/ir/ts/ |
| D | tsAsExpression.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 35 …dumper->Add({{"type", "TSAsExpression"}, {"expression", expression_}, {"typeAnnotation", typeAnnot… in Dump() 40 expression_->Compile(pg); in Compile() 45 switch (arg->Type()) { in IsValidConstAssertionArgument() 46 case ir::AstNodeType::NUMBER_LITERAL: in IsValidConstAssertionArgument() 47 case ir::AstNodeType::STRING_LITERAL: in IsValidConstAssertionArgument() 48 case ir::AstNodeType::BIGINT_LITERAL: in IsValidConstAssertionArgument() 49 case ir::AstNodeType::BOOLEAN_LITERAL: in IsValidConstAssertionArgument() 50 case ir::AstNodeType::ARRAY_EXPRESSION: in IsValidConstAssertionArgument() 51 case ir::AstNodeType::OBJECT_EXPRESSION: in IsValidConstAssertionArgument() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/ets/ |
| D | etsPrimitiveType.cpp | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 29 it->SetTransformedNode(transformationName, transformedNode); in TransformChildren() 30 it = transformedNode->AsAnnotationUsage(); in TransformChildren() 44 … dumper->Add({{"type", "ETSPrimitiveType"}, {"annotations", AstDumper::Optional(Annotations())}}); in Dump() 50 anno->Dump(dumper); in Dump() 53 case PrimitiveType::BYTE: in Dump() 54 dumper->Add("byte"); in Dump() 56 case PrimitiveType::INT: in Dump() 57 dumper->Add("int"); in Dump() [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/expressions/ |
| D | assignmentExpression.cpp | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 27 switch (left_->Type()) { in ConvertibleToAssignmentPatternLeft() 28 case AstNodeType::ARRAY_EXPRESSION: { in ConvertibleToAssignmentPatternLeft() 29 return left_->AsArrayExpression()->ConvertibleToArrayPattern(); in ConvertibleToAssignmentPatternLeft() 31 case AstNodeType::SPREAD_ELEMENT: { in ConvertibleToAssignmentPatternLeft() 32 return mustBePattern && left_->AsSpreadElement()->ConvertibleToRest(false); in ConvertibleToAssignmentPatternLeft() 34 case AstNodeType::OBJECT_EXPRESSION: { in ConvertibleToAssignmentPatternLeft() 35 return left_->AsObjectExpression()->ConvertibleToObjectPattern(); in ConvertibleToAssignmentPatternLeft() 37 case AstNodeType::ASSIGNMENT_EXPRESSION: { in ConvertibleToAssignmentPatternLeft() [all …]
|
| /arkcompiler/runtime_core/libabckit/include/cpp/headers/ |
| D | base_concepts.h | 7 * http://www.apache.org/licenses/LICENSE-2.0 30 * @brief Lightweight checker that ensures core<->target API conversion validity 31 * It is designed to be empty class type. 32 * In case of inheritance the empty base optimization will be applied 34 * In case of non-static member, it should be combined with ABCKIT_NO_UNIQUE_ADDRESS attribute 35 * @tparam TargetT - View class for a target specialized C API (not core) 41 * @brief Provides compile-time static contract checks 47 * pre-C++20 concept idiom with SFINAE and decltype to check type expression valideness 48 * @tparam T - type that is inspected againts the contract 49 * @note A general case to be matched (to false) if more specialized case fail [all …]
|
| /arkcompiler/runtime_core/tests/cts-generator/generator/ |
| D | generator.rb | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 37 TEST_NAME = 'file-name' 48 TEST_PANDA_OPTIONS = 'panda-options' 49 TEST_RUN_OPTIONS = 'runner-options' 52 COMMAND_FILE_NAME = 'file-name' 53 TEST_CODE_TEMPLATE = 'code-template' 54 TEST_HEADER_TEMPLATE = 'header-template' 55 TEST_CHECK_TYPE = 'check-type' 59 TEST_TEMPLATE_CASES = 'template-cases' [all …]
|
| /arkcompiler/runtime_core/static_core/tests/cts-generator/generator/ |
| D | generator.rb | 1 # Copyright (c) 2021-2024 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 37 TEST_NAME = 'file-name' 48 TEST_PANDA_OPTIONS = 'panda-options' 49 TEST_RUN_OPTIONS = 'runner-options' 52 COMMAND_FILE_NAME = 'file-name' 53 TEST_CODE_TEMPLATE = 'code-template' 54 TEST_HEADER_TEMPLATE = 'header-template' 55 TEST_CHECK_TYPE = 'check-type' 59 TEST_TEMPLATE_CASES = 'template-cases' [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/base/ |
| D | spreadElement.cpp | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 25 …sion(static_cast<AnnotatedExpression const &>(other), allocator), decorators_(allocator->Adapter()) in SpreadElement() 29 argument_ = other.argument_->Clone(allocator, this)->AsExpression(); in SpreadElement() 32 decorators_.emplace_back(decorator->Clone(allocator, this)); in SpreadElement() 38 auto *const clone = allocator->New<SpreadElement>(Tag {}, *this, allocator); in Clone() 41 clone->SetParent(parent); in Clone() 50 switch (argument_->Type()) { in ValidateExpression() 51 case AstNodeType::OBJECT_EXPRESSION: { in ValidateExpression() 52 info = argument_->AsObjectExpression()->ValidateExpression(); in ValidateExpression() [all …]
|
| D | property.cpp | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 33 auto *const key = key_ != nullptr ? key_->Clone(allocator, nullptr)->AsExpression() : nullptr; in Clone() 34 …auto *const value = value_ != nullptr ? value_->Clone(allocator, nullptr)->AsExpression() : nullpt… in Clone() 35 auto *const clone = allocator->New<Property>(Tag {}, *this, key, value); in Clone() 38 key->SetParent(clone); in Clone() 41 value->SetParent(clone); in Clone() 44 clone->SetParent(parent); in Clone() 56 switch (value_->Type()) { in ConvertibleToPatternProperty() 57 case AstNodeType::OBJECT_EXPRESSION: { in ConvertibleToPatternProperty() [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/map/Get/ |
| D | builtinMapGet.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 43 …ap = new Map([[0, 0], [0.0, 5], [-1, 1], [2.5, -2.5], [NaN, Infinity], [2000, -0.0], [56, "oops"],… 45 // Check without params 49 // Check with adding element undefined 54 // Check with single param 60 print(myMap.get(2.5)); //: -2.5 64 print("1/x: " + 1 / myMap.get(2000)); //: 1/x: -Infinity 66 // Check with 2 params 70 // Check with 3 params 72 print(myMap.get(-1, 10.2, 15)); //: 1 [all …]
|
| /arkcompiler/ets_frontend/ets2panda/ir/statements/ |
| D | labelledStatement.cpp | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 28 ident_->SetTransformedNode(transformationName, transformedNode); in TransformChildren() 29 ident_ = transformedNode->AsIdentifier(); in TransformChildren() 33 body_->SetTransformedNode(transformationName, transformedNode); in TransformChildren() 34 body_ = transformedNode->AsStatement(); in TransformChildren() 46 dumper->Add({{"type", "LabelledStatement"}, {"label", ident_}, {"body", body_}}); in Dump() 52 ident_->Dump(dumper); in Dump() 53 dumper->Add(":"); in Dump() 54 dumper->Endl(); in Dump() [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/Array/ForEach/ |
| D | builtinArrayForEach.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 49 // Check without args 70 // Check inside try-block 89 //aot: [trace] Check Type: BuiltinInstanceHClassMismatch 98 //aot: [trace] Check Type: InconsistentElementsKind 105 print('case 1 forEach') //: case 1 forEach 113 print(arr2.forEach(x => x == 1)); //aot: [trace] Check Type: BuiltinInstanceHClassMismatch 120 print('case 2 forEach') //: case 2 forEach 138 print('case 3 forEach') //: case 3 forEach 150 print(marr.forEach(x => x == 1)); //aot: [trace] Check Type: BuiltinInstanceHClassMismatch [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtin_inlining/Array/Pop/ |
| D | builtinArrayPop.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 20 var x = [1,2.1,-1,null,undefined,,false,NaN] 38 // Check inside try-block 81 //aot: [trace] Check Type: BuiltinInstanceHClassMismatch 100 printPop(-1); //pgo: 2 101 //aot: [trace] Check Type: NotCallTarget1 102 //aot: -1 105 //aot: [trace] Check Type: NotCallTarget1 111 print('case 1 pop') //: case 1 pop 119 print(arr2.pop()); //aot: [trace] Check Type: BuiltinInstanceHClassMismatch [all …]
|
| /arkcompiler/ets_frontend/es2panda/ir/expressions/ |
| D | binaryExpression.cpp | 7 * http://www.apache.org/licenses/LICENSE-2.0 33 dumper->Add({{"type", IsLogical() ? "LogicalExpression" : "BinaryExpression"}, in Dump() 42 compiler::VReg lhs = pg->AllocReg(); in CompileLogical() 47 auto *skipRight = pg->AllocLabel(); in CompileLogical() 48 auto *endLabel = pg->AllocLabel(); in CompileLogical() 50 // left -> acc -> lhs -> toboolean -> acc -> bool_lhs in CompileLogical() 51 left_->Compile(pg); in CompileLogical() 52 pg->StoreAccumulator(this, lhs); in CompileLogical() 55 pg->BranchIfFalse(this, skipRight); in CompileLogical() 57 pg->BranchIfTrue(this, skipRight); in CompileLogical() [all …]
|