| /arkcompiler/ets_frontend/ets2panda/test/runtime/ets/ |
| D | array-object.ets | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 19 let object_array: FixedArray<Object> = arr1 as FixedArray<Object>; 20 let obj: Object = arr1 as Object; 22 // TypeError: Cannot access property of non-object or non-enum type 29 // TypeError: Cannot access property of non-object or non-enum type 41 // Cannot cast type 'int[]' to 'Object[]' 42 // let object_array2: Object[] = arr2 as Object[]; 43 // assertEQ(obj.equals(arr2 as Object), false)
|
| /arkcompiler/ets_frontend/ets2panda/linter/test/ts_import_ets/ts/ |
| D | test7.ts.json | 3 "Copyright (c) 2023-2024 Huawei Device Co., Ltd.", 8 "http://www.apache.org/licenses/LICENSE-2.0", 24 … \"Sendable\" interfaces are allowed for importing from ets into ts file (arkts-no-ts-import-ets)", 34 … \"Sendable\" interfaces are allowed for importing from ets into ts file (arkts-no-ts-import-ets)", 44 …"rule": "Casting \"Non-sendable\" data to \"Sendable\" type is not allowed (arkts-sendable-as-expr… 54 …of \"Sendable\" type can not be initialized using object literal or array literal (arkts-sendable-… 64 …"rule": "Casting \"Non-sendable\" data to \"Sendable\" type is not allowed (arkts-sendable-as-expr… 74 …of \"Sendable\" type can not be initialized using object literal or array literal (arkts-sendable-… 84 …"rule": "Casting \"Non-sendable\" data to \"Sendable\" type is not allowed (arkts-sendable-as-expr… 94 …of \"Sendable\" type can not be initialized using object literal or array literal (arkts-sendable-… [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/17.experimental_features/18.generics_experimental/ |
| D | generics_nonull_return_ext.params.yaml | 6 # http://www.apache.org/licenses/LICENSE-2.0 14 --- # Interfaces with static members and type parameters inside 16 - desc: Force return of non-empty generic instance, using object as generic type. 17 decl: |- 23 logic: |- 24 let a = new A<Object>(); 25 let result = a.foo(new Object()); 27 …- desc: Force return of a non-empty generic instance, Using an inherited union type object | null. 28 Using object as generic type. 29 decl: |- [all …]
|
| D | generics_nonull_return00.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 /*--- 17 desc: Non-mandatory return of a non-empty instance generic test, using object as the type. 18 ---*/ 27 let a = new A<Object>(); 28 let result = a.foo(new Object());
|
| D | generics_nonull_return.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 /*--- 17 desc: Non-mandatory return of non-empty instance generic testing. 18 ---*/ 27 let a = new A<Object>(); 28 let result = a.foo(new Object());
|
| D | generics_nonull_return3.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 /*--- 17 desc: Non-mandatory return of a non-empty generic instance, Using an inherited union type object | … 18 Using object as generic type. 19 ---*/
|
| D | generics_nonull_return5.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 16 /*--- 17 desc: Non-mandatory return of a non-empty generic instance, Using an inherited union type object | … 18 Using object as generic type. 19 ---*/
|
| /arkcompiler/ets_runtime/test/sharedtest/sendable/ |
| D | expect_output.txt | 6 # http://www.apache.org/licenses/LICENSE-2.0 15 sendable inherit from non-sendable failed. err: TypeError: Class not derived from a sendable object… 16 sendable change proto failed. err: TypeError: Cannot set proto with sendable object, code: undefined 17 non-sendable inherit from non-sendable succeed. 18 non-sendable inherit from sendable failed. err: TypeError: The subclass of sendable class must be a… 20 sendable contain non-sendable failed. err: TypeError: Cannot set sendable property with mismatched … 21 sendable contain static non-sendable failed. err: TypeError: Cannot set sendable property with mism…
|
| D | sendable.ts | 7 * http://www.apache.org/licenses/LICENSE-2.0 45 print('sendable inherit from non-sendable failed. err: ' + err + ', code: ' + err.code); 66 // 2. non-sendable can not inherit from sendable 76 print('non-sendable inherit from non-sendable succeed.'); 78 print('non-sendable inherit from non-sendable failed. err: ' + err + ', code: ' + err.code); 91 print('non-sendable inherit from sendable succeed.'); 93 print('non-sendable inherit from sendable failed. err: ' + err + ', code: ' + err.code); 96 // 3. non-sendable can not implement sendable 129 print('sendable contain non-sendable succeed.'); 131 print('sendable contain non-sendable failed. err: ' + err + ', code: ' + err.code); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/std/core/ |
| D | TypeInterfaceTypeTest.ets | 2 * Copyright (c) 2021-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 26 doA(): Object; 30 doB(): Object; 34 doC(): Object; 38 doD(): Object; 42 override doA(): Object { 43 return new Int() as Object 45 override doC(): Object { 46 return "" as Object [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_test_suite/gc/ |
| D | run_gc_every_safepoint.ets | 2 * Copyright (c) 2023-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 17 let obj_array: FixedArray<Object> = new Object[4]; 19 obj_array[i] = new Object(); 20 …assertLT(0, GC.getObjectAddress(obj_array[i]), "getObjectAddress for regular object must return va… 23 …assertLT(0, GC.getObjectAddress(obj_array[i]), "getObjectAddress for regular object must return va… 28 let obj = new Object(); 29 …assertLT(0, GC.getObjectAddress(obj), "getObjectAddress for regular object must return value > 0"); 30 …assertLT(0, GC.getObjectAddress("non-movable string"), "getObjectAddress for non-movable must retu…
|
| D | get_object_address_test.ets | 2 * Copyright (c) 2023-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 17 let obj = new Object(); 18 …assertLT(0, GC.getObjectAddress(obj), "getObjectAddress for regular object must return value > 0"); 19 …assertLT(0, GC.getObjectAddress("non-movable string"), "getObjectAddress for non-movable must retu…
|
| D | weak_ref_test.ets | 2 * Copyright (c) 2023-2025 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 16 function CreateWeakRefObject(): WeakRef<Object> 18 let obj = new Object(); 19 return new WeakRef<Object>(obj); 22 function CreateWeakRefForConcurrent(): WeakRef<Object> 26 return new WeakRef<Object>(obj); 45 const reachable_obj = new Object(); 51 let wr_with_reachable = new WeakRef<Object>(reachable_obj); 59 assertEQ(wr.deref(), undefined, "Object referent must be collected after Full GC"); [all …]
|
| /arkcompiler/runtime_core/static_core/tests/cts-assembly/ |
| D | obj-18.pa | 1 # Copyright (c) 2021-2024 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 14 # Compare a non-null object against another non-null object of the same type
|
| /arkcompiler/runtime_core/tests/cts-assembly/ |
| D | obj-18.pa | 1 # Copyright (c) 2021-2022 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 14 # Compare a non-null object against another non-null object of the same type
|
| /arkcompiler/runtime_core/static_core/libziparchive/extractortool/ |
| D | zip_file.h | 7 * http://www.apache.org/licenses/LICENSE-2.0 39 // Local file header: descript in APPNOTE-6.3.4 46 // crc-32 4 bytes 74 // crc-32 4 bytes 20 131 // crc-32 4 bytes 143 struct ZipEntry { // NOLINT(cppcoreguidelines-special-member-functions) 148 uint16_t compressionMethod = 0; // NOLINT(misc-non-private-member-variables-in-classes) 149 uint32_t uncompressedSize = 0; // NOLINT(misc-non-private-member-variables-in-classes) 150 uint32_t compressedSize = 0; // NOLINT(misc-non-private-member-variables-in-classes) 151 uint32_t localHeaderOffset = 0; // NOLINT(misc-non-private-member-variables-in-classes) [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/Deque/ |
| D | DequeCreateLengthInsertTests.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 21 …suite.addTest("Deque create an instance that stores single-type data", testCreateSingleTypeInstanc… 27 suite.addTest("Deque insert object at the front of the deque", testInsertObjectFront); 30 suite.addTest("Deque insert object at the end of the deque", testInsertObjectEnd); 59 assertTrue(false, "Failed to create a single-type instance of Deque"); 71 assertTrue(false, "Failed to create a single-type instance of Deque"); 120 … assertEQ(value, TestData.forNumber[TestData.testInt29 - countForEach++], "Element should match"); 127 let deque = new Deque<object>(); 129 …assertEQ(deque.getFirst(), TestData.testObject1, "Get first from non-empty deque should return fir… 132 …assertEQ(deque.getFirst(), TestData.testObject2, "Get first from non-empty deque should return fir… [all …]
|
| /arkcompiler/ets_frontend/ets2panda/test/ast/compiler/ets/ |
| D | array_with_type_parameter.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 70 new (T|Object)[2] 83 new [T|Object][2] 95 … TypeError: Cannot use array creation expression with non-constructable element type which is non-… 96 … TypeError: Cannot use array creation expression with non-constructable element type which is non-… 97 … TypeError: Cannot use array creation expression with non-constructable element type which is non-… 98 … TypeError: Cannot use array creation expression with non-constructable element type which is non-…
|
| /arkcompiler/ets_runtime/test/sharedtest/sharedcollectionsexception/ |
| D | expect_output.txt | 6 # http://www.apache.org/licenses/LICENSE-2.0 61 Init with small first element: -1 success. 64 Create with non-sendable element fail. err: BusinessError: Parameter error.Only accept sendable val… 66 Create from non-sendable iterator fail. err: BusinessError: Parameter error.Only accept sendable va… 67 Create from non-sendable element fail. err: BusinessError: Parameter error.Only accept sendable val… 68 Create from mapper: non-sendable element fail. err: BusinessError: Parameter error.Only accept send… 72 concat with non-sendable array fail.err: BusinessError: Parameter error.Only accept sendable value.… 73 concat with non-sendable element fail. err: BusinessError: Parameter error.Only accept sendable val… 75 fill array with non-sendable object and position fail. err: BusinessError: Parameter error.Only acc… 76 fill array with non-sendable object and start position fail. err: BusinessError: Parameter error.On… [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/05.generics/01.type_parameters/01.type_parameter_constraint/generic_classes/ |
| D | generic_class_object_compatibility.ets | 1 /*--- 7 * http://www.apache.org/licenses/LICENSE-2.0 14 ---*/ 18 /*--- 19 desc: >- 20 If no constraint is specified, then type parameter is not compatible with Object, 22 Lack of constraint effectively means extends Object|null|undefined. 23 If the constraint S is a non-nullish type (see Nullish Types), then T is also non-nullish. 26 ---*/
|
| /arkcompiler/ets_frontend/ets2panda/linter/test/main/ |
| D | sendable_as_expr.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 23 let v1 = new NonSendableClass4() as SendableClass6; // ERROR, non-sendable data can not be cast to … 27 let v2 = tmp1 as SendableClass6; // ERROR, non-sendable data can not be cast to "Sendable" data 29 function foo(a: object) { 33 function foo(a: Object) { 38 a as SendableClass6; // OK, no arkts-sendable-as-expr error
|
| D | type_literals.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 115 export function captureFromLocalScope<T>(t: T): {ret: T} { // Non-fixable, type captures type param… 116 let v1: {local: T}; // Non-fixable, type captures type parameter from enclosing declaration 119 …let v2: { x: LocalType } = {x: {a: 1, b: '2'}}; // Non-fixable, type captures another type declare… 121 …type LocalType2<K> = ({k: K}); // Non-fixable, type captures type parameter from enclosing declara… 124 let v3: {[one]: 1}; // Non-fixable, type captures another object declared in local scope 127 …let v4: { y: LocalClass } = {y: new LocalClass()}; // Non-fixable, type captures another type decl… 129 …let v5: { lc: typeof LocalClass }; // Non-fixable, type captures another type declared in local sc… 131 let v6: { lc: typeof v1 }; // Non-fixable, type captures another object declared in local scope
|
| D | object_literals_autofixes.ets | 7 * http://www.apache.org/licenses/LICENSE-2.0 45 // Properties with various types. Nested object literals 66 // Object literals inside another expression 75 // Object literals inside class declaration 89 // Object literals as function parameter initializer 93 // Object literals inside function declaration 117 … property 'c' is initialized with non-fixable nested object literal, and thus will always have uns… 136 …let v4 = { x: localTypeVar }; // Non-fixable, `x` references type `LocalType` declared in local sc… 139 …let v5 = { y: new LocalClass() }; // Non-fixable, `y` references type `LocalClass` declared in loc… 141 …let v6 = { z: LocalClass }; // Non-fixable, `z` references type `LocalClass` declared in local sco… [all …]
|
| /arkcompiler/runtime_core/libpandabase/mem/ |
| D | space.h | 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 7 * http://www.apache.org/licenses/LICENSE-2.0 28 SPACE_TYPE_OBJECT, // Space for objects (all non-humongous sizes) 30 SPACE_TYPE_NON_MOVABLE_OBJECT, // Space for non-movable objects 55 return "ark-Undefined Space"; in SpaceTypeToString() 57 return "ark-Object Space"; in SpaceTypeToString() 59 return "ark-Humongous Object Space"; in SpaceTypeToString() 61 return "ark-Non Movable Space"; in SpaceTypeToString() 63 return "ark-Internal Space"; in SpaceTypeToString() 65 return "ark-Code Space"; in SpaceTypeToString() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates_deprecated/15.exceptions/05.exceptions_and_errors_inside_field_initializers/ |
| D | fld_obj.params.yaml | 1 # Copyright (c) 2024-2025 Huawei Device Co., Ltd. 6 # http://www.apache.org/licenses/LICENSE-2.0 14 --- 17 - decl: |- 18 function foo(p: number): Object throws { 22 return new Object() 25 static fld: Object|null|undefined = foo(4.0) // CTE expected 27 use: |- 29 tags: 'compile-only, negative' 32 - decl: |- [all …]
|