| /arkcompiler/ets_runtime/test/moduletest/arraystablecheck/ |
| D | arraystablecheck.js | 22 let arr1 = new Array(1023); variable 24 print(ArkTools.isStableJsArray(arr1)); 36 let arr1 = new Array(1023); variable 38 arr1.__proto__ = arr2; 39 print(ArkTools.isStableJsArray(arr1)); 48 let arr1 = new Array(1026); variable 50 print(ArkTools.isStableJsArray(arr1)); 62 let arr1 = new MyArray(1023); variable 64 let arr3 = arr1.concat(arr2); 66 print(ArkTools.isStableJsArray(arr1)); [all …]
|
| /arkcompiler/ets_frontend/ets2panda/test/runtime/ets/ |
| D | array-object.ets | 17 let arr1: FixedArray<Int> = [1,2,3,4,5]; 19 let object_array: FixedArray<Object> = arr1 as FixedArray<Object>; 20 let obj: Object = arr1 as Object; 23 // arr1.toString(); 30 // arr1.$_hashCode(); 36 assertEQ(arr1, arr1) 37 assertEQ(arr1, object_array) 38 assertEQ(arr1, obj) 39 assertNE(arr1, arr2)
|
| D | readonly_parameter_test_4.ets | 17 function foo1 (tuple1: [number, string, boolean], arr1: number[]) { 18 let arr2 = arr1 as readonly number[] 19 let arr3 = arr1 as Readonly<number[]> 26 let arr1 : int[] = [1, 2] 27 let arr2 = arr1 as readonly int[] 28 let arr3 = arr1 as Readonly<int[]>
|
| D | SpreadExpressionsforFunctionCall_tuple.ets | 33 let arr1 = [...a./*xxxxx*/foo(), ...foo()] 34 assertEQ(arr1.length, 5) 35 assertEQ(arr1[0], 7) 36 assertEQ(arr1[1], "a") 37 assertEQ(arr1[2], true) 38 assertEQ(arr1[3], "b") 39 assertEQ(arr1[4], 1)
|
| D | SpreadExpressionsforThisAndSuper.ets | 61 let arr1 = [...a1.meth()] 62 assertEQ(arr1.length, 6) 63 assertTrue(arr1[0] == 10 && arr1[1] == 20 && arr1[2] == 1) 64 assertTrue(arr1[3] == 2 && arr1[4] == 3 && arr1[5] == 30)
|
| D | SpreadExpressionsforFunctionCall.ets | 33 let arr1:Int[] = [...a.foo(), ...foo()] 34 assertEQ(arr1.length, 3) 35 assertEQ(arr1[0], 7) 36 assertEQ(arr1[1], 1) 37 assertEQ(arr1[2], 2)
|
| D | SpreadExpressionsforFunctionCall_ResizableArray.ets | 37 let arr1:Int[] = [...a.foo(), ...foo()] 38 assertEQ(arr1.length, 3) 39 assertEQ(arr1[0], 7) 40 assertEQ(arr1[1], 1) 41 assertEQ(arr1[2], 2)
|
| D | nestedNameSpaceWithStaticField.ets | 18 static arr1 = [1, 2, 3] 38 C.a[0].arr2[2] += A.C1.arr1[1] 40 A.C1.arr1[1] -= B.X.C2.a + 5 41 assertTrue(A.C1.arr1[1] == -8)
|
| /arkcompiler/ets_frontend/ets2panda/linter/test/interop/ |
| D | interop_import_js_index.ets | 21 let arr1 = ff3.arr 22 let len = arr1.length as number 23 for (let i = 0; i < arr1.length; ++i) { 24 console.log(arr1[i]+''); //error 25 let x = arr1[i] //error 26 arr1[i] = 0 //error 27 console.log(arr1[i]+''); //error 30 for (let element of arr1) { //error
|
| D | interop_import_js_index.ets.migrate.ets | 25 let arr1 = ff3.getProperty("arr") 26 let len: number = arr1.getProperty("length") as number 27 for (let i: number = 0.0; i < arr1.getProperty("length"); ++i) { 28 console.log(arr1.getProperty(i).toNumber()+''); //error 29 let x = arr1.getProperty(i).toNumber() //error 30 arr1.setProperty(i, ESValue.wrap(0.0 //error 32 console.log(arr1.getProperty(i).toNumber()+''); //error 35 for (let element of arr1) { //error
|
| /arkcompiler/runtime_core/static_core/tests/cts-generator/cts-template/ |
| D | lda.const.yaml | 42 lda.const v0, arr1 45 - values: ['.array arr1'] 46 - values: ['.array arr1 i32'] 47 - values: ['.array arr1 i32 4'] 50 - values: ['.array arr1 i32 4 { }'] 51 - values: ['.array arr1 i32 4 { 1 }'] 52 - values: ['.array arr1 i32 4 { 1 2 3 4 5 }'] 53 - values: ['.array arr1 i32 0 { }'] 54 - values: ['.array arr1 i32[] 1 { 1 }'] 55 - values: ['.array arr1 panda.String 1 { }'] [all …]
|
| /arkcompiler/runtime_core/tests/cts-generator/cts-template/ |
| D | lda.const.yaml | 42 lda.const v0, arr1 45 - values: ['.array arr1'] 46 - values: ['.array arr1 i32'] 47 - values: ['.array arr1 i32 4'] 50 - values: ['.array arr1 i32 4 { }'] 51 - values: ['.array arr1 i32 4 { 1 }'] 52 - values: ['.array arr1 i32 4 { 1 2 3 4 5 }'] 53 - values: ['.array arr1 i32 0 { }'] 54 - values: ['.array arr1 i32[] 1 { 1 }'] 55 - values: ['.array arr1 panda.String 1 { }'] [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_sdk/api/@ohos/util/ArrayList/ |
| D | ArrayListTest.ets | 64 let arr1 = new ArrayList<number>(); 68 arr1.add(i); 72 assertEQ(arr1[i], testArray[i], `The element at index ${i} should be ${testArray[i]}`); 75 assertTrue(arr1.has(2), "The ArrayList should contain the value 2"); 76 assertEQ(arr1.getCapacity(), 10, "The capacity of the ArrayList should be 10"); 77 assertEQ(arr1.getLastIndexOf(1), 1, "The last index of value 1 should be 1"); 78 assertEQ(arr1.getIndexOf(5), 5, "The index of value 5 should be 5"); 80 let array = arr1.convertToArray(); 85 let newArrayList = arr1.clone(); 91 arr1.insert(999, 3); [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/test/main/ |
| D | array_index_expr_type.ets | 62 let arr1:number[] = [1, 2, 3] 67 arr1[TE.AA]; 68 arr1[TE.BB]; 69 arr1[+0]; 70 arr1[-0]; 71 arr1[+1]; 72 arr1[-1]; 73 arr1[1.1 as number];
|
| D | array_index_expr_type.ets.migrate.ets | 62 let arr1:number[] = [1.0, 2.0, 3.0] 67 arr1[TE.AA as int]; 68 arr1[TE.BB]; 69 arr1[+0]; 70 arr1[-0]; 71 arr1[+1]; 72 arr1[-1]; 73 arr1[1.1 as int];
|
| D | runtime_array_bound.ets.migrate.ets | 142 let arr1:number[] = [1.0, 1.5,45.0,2.0] 148 arr1[3*5] = 23.0; 149 arr1[parseInt("16") as int] = 23.0; 150 arr1[foo(16) as int] = 23.0 152 let arr1:number[] = [1.0, 1.5,45.0,2.0] 154 arr1[Number.MAX_VALUE as int] = 23.0; 155 arr1[Number.MAX_SAFE_INTEGER as int] = 23.0; 157 let arr1:number[] = [1.0, 1.5,45.0,2.0] 161 arr1[(24)] = 23.0; 162 arr1[+24] = 23.0; [all …]
|
| D | runtime_array_bound.ets | 142 let arr1:number[] = [1, 1.5,45,2] 148 arr1[3*5] = 23; 149 arr1[parseInt("16")] = 23; 150 arr1[foo(16)] = 23 152 let arr1:number[] = [1, 1.5,45,2] 154 arr1[Number.MAX_VALUE] = 23; 155 arr1[Number.MAX_SAFE_INTEGER] = 23; 157 let arr1:number[] = [1, 1.5,45,2] 161 arr1[(24)] = 23; 162 arr1[+24] = 23; [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/interop_js/tests/escompat/array_js_suites/ |
| D | test_splice.js | 46 let arr1 = CreateEtsSample(); variable 47 arr1.push('spliced'); 48 ASSERT_EQ(etsArrLen(arr1), EXPECT_3); 51 arr1.splice(1); 52 ASSERT_EQ(arr1.at(0), 123); 53 ASSERT_EQ(arr1.length, 1);
|
| /arkcompiler/ets_runtime/test/moduletest/arrayfindlast/ |
| D | arrayfindlast.js | 79 let arr1 = [1, 2, , 7, , undefined]; variable 80 arr1.__proto__.push(9); 81 arr1.__proto__.push(9); 82 arr1.__proto__.push(9); 86 print(arr1.findLast(fun1)); 87 arr1.__proto__.pop(9); 88 arr1.__proto__.pop(9); 89 arr1.__proto__.pop(9);
|
| /arkcompiler/ets_runtime/test/moduletest/arrayfillproto/ |
| D | arrayfillproto.js | 21 let arr1 = new Array(500); variable 22 arr1.__proto__.length = 10; 23 arr1.__proto__.fill(233, 0, 7); 25 let arr3 = arr1.concat(arr2);
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_func_tests/escompat/ |
| D | ArrayEveryTest.ets | 46 const arr1: Array<number> = Array.of<number>(1, 2, 3) 48 const result1 = arr1.every(x => { 50 arr1.push(4) 55 assertEQ(arr1[0], 1) 56 assertEQ(arr1[1], 2) 57 assertEQ(arr1[2], 3) 58 assertEQ(arr1[3], 4) 59 assertEQ(arr1[4], 4) 60 assertEQ(arr1[5], 4)
|
| /arkcompiler/ets_runtime/test/moduletest/arrayconcat/ |
| D | arrayconcat.js | 65 let arr1 = new Array(2000); variable 66 arr1[0] = 1; 67 arr1[1] = 1; 69 arr2.__proto__ = arr1; 85 let arr1 = new Array(10); variable 86 arr1[0] = 1; 87 arr1[1] = 1; 89 arr2.__proto__ = arr1; 105 let arr1 = new Array(2000); variable 106 arr1[0] = 1; [all …]
|
| /arkcompiler/ets_frontend/arkguard/test/ut/utils/ |
| D | ListUtil.spec.ts | 81 let arr1 = undefined; variable 84 const arrUnique = ListUtil.uniqueMergeList(arr1, arr2); 89 let arr1 = ['1', '2', '3']; variable 94 const arrUnique = ListUtil.uniqueMergeList(arr1, arr2); 102 let arr1 = ['1', '2', '3', '4']; variable 107 const arrUnique = ListUtil.uniqueMergeList(arr1, arr2); 115 let arr1 = undefined; variable 119 const arrUnique = ListUtil.uniqueMergeList(arr1, arr2, arr3); 124 let arr1 = ['1', '2', '3']; variable 130 const arrUnique = ListUtil.uniqueMergeList(arr1, arr2, arr3); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/interop_js/tests/rest_spread_parameter/ts_to_ets/ |
| D | test_rest_spread.ets | 18 function compareArraysAreEqual<T>(arr1: FixedArray<T>, arr2: FixedArray<T>) { 19 if(arr1.length !== arr2.length) { 22 for(let i = 0; i < arr1.length; i++) { 23 if (Array.isArray(arr1[i]) && Array.isArray(arr2[i])) { 24 if (!compareArraysAreEqual(arr1[i], arr2[i])) { 28 if(arr1[i] !== arr2[i]) {
|
| /arkcompiler/ets_runtime/test/moduletest/arrayjoin/ |
| D | arrayjoin.js | 59 var arr1 = [1]; 60 arr1.push(arr1); 61 arr1.push(arr1); 62 print(arr1.toString()); 63 print(arr1.toString());
|