| /arkcompiler/ets_frontend/es2panda/test/ |
| D | test262skiplist-compiler-arm64.txt | 2 built-ins/Array/prototype/reduce/15.4.4.21-1-11.js 3 built-ins/Array/prototype/reduce/15.4.4.21-1-12.js 4 built-ins/Array/prototype/reduce/15.4.4.21-1-14.js 5 built-ins/Array/prototype/reduce/15.4.4.21-1-3.js 6 built-ins/Array/prototype/reduce/15.4.4.21-1-4.js 7 built-ins/Array/prototype/reduce/15.4.4.21-1-5.js 8 built-ins/Array/prototype/reduce/15.4.4.21-1-6.js 9 built-ins/Array/prototype/reduce/15.4.4.21-1-7.js 10 built-ins/Array/prototype/reduce/15.4.4.21-1-8.js 11 built-ins/Array/prototype/reduce/15.4.4.21-1-9.js [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/stdlib-templates/escompat/ |
| D | escompat_Array_methods.sts | 25 …ures += check((): int => { return testCreateFrom()}, "Test Create Array<Object> object from array") 26 …= check((): int => { return testCreateFrom2()}, "Test Create Array<Object> object from array with … 27 failures += check((): int => { return testEvery()}, "Test Array<Object> every() method") 28 failures += check((): int => { return testSome()}, "Test Array<Object> some() method") 29 failures += check((): int => { return testSomeNegative()}, "Test Array<Object> some() method") 30 …failures += check((): int => { return testMap0()}, "Test create new Array<Object> object apply giv… 31 failures += check((): int => { return testReverse()}, "Test Array<Object> reverse function") 33 failures += check((): int => { return testFill0()}, "Test Array<Object> fill(0) method") 34 failures += check((): int => { return testFill3()}, "Test Array<Object> fill(3) method") 35 failures += check((): int => { return testConcat()}, "Test Array<Object> concatenate method") [all …]
|
| D | escompat_Array_modifications.sts | 25 …failures += check((): int => { return testPushEmpty()}, "Test push() method with empty Array<Objec… 31 …failures += check((): int => { return testShiftEmpty()}, "Test shift() method with empty Array<Obj… 46 const array = Array.from<object>(source) 47 let length = array.length 49 let shifted = array.shift() 52 if (array.length != length) { 53 console.println("Target array length mismatch: " + array.length + " but expected" + length) 62 for (let i: int = 0; i < array.length; i++) { 64 if (array.at(i) == source[j]) continue 73 let array: Array<Object> = new Array<Object>() [all …]
|
| D | escompat_Array_misc.sts | 31 …lures += check((): int => { return testJoinEmpty()}, "Test join(0) method with empty source array") 44 …lures += check((): int => { return testIndexOfFromEmpty()}, "Test indexOf method with empty array") 47 failures += check((): int => { return array{{.ci.name}}()}, "Test262: {{.ci.name}}") 61 const array = Array.from<object>(source) 63 if (array.length != source.length) { 68 for (let i: int = 0; i < array.length; i++) { 69 if (array.includes(source[i])) continue 80 let src = new Array<Object>(empty) 91 const src = Array.from<object>(source2) 102 const src = Array.from<object>(source2) [all …]
|
| /arkcompiler/runtime_core/static_core/runtime/coretypes/ |
| D | array.cpp | 16 #include "runtime/include/coretypes/array.h" 27 static Array *AllocateArray(ark::BaseClass *arrayClass, size_t elemSize, ArraySizeT length, ark::Sp… in AllocateArray() 30 size_t size = Array::ComputeSize(elemSize, length); in AllocateArray() 32 …LOG(ERROR, RUNTIME) << "Illegal array size: element size: " << elemSize << " array length: " << le… in AllocateArray() 33 ThrowOutOfMemoryError("OOM when allocating array"); in AllocateArray() 37 return static_cast<coretypes::Array *>( in AllocateArray() 42 return static_cast<coretypes::Array *>(vm->GetHeapManager()->AllocateNonMovableObject( in AllocateArray() 49 Array *Array::Create(ark::Class *arrayClass, const uint8_t *data, ArraySizeT length, ark::SpaceType… in Create() 53 auto *array = AllocateArray(arrayClass, elemSize, length, spaceType, pinned); in Create() local 54 if (UNLIKELY(array == nullptr)) { in Create() [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets-templates/07.expressions/04.array_literal/ |
| D | array_literal.params.yaml | 14 --- # List of valid array composites 16 # empty array 17 - { array: '[]', type: number, len: 0 } 19 # array of primitives 20 - { array: '[1, 2, 3]', type: int, len: 3 } 22 # array of boxed 23 - { array: '[new Double(3.1415926)]', type: Double, len: 1 } 25 # array of strings 26 - { array: '["aaa", "bbb"]', type: string, len: 2 } 28 # array of Objects [all …]
|
| /arkcompiler/ets_runtime/test/sharedtest/sharedarray/ |
| D | sharedarray.ts | 248 let array: SendableArray<number> = new SendableArray<number>(1, 3, 5); 249 print("Array length: " + array.length); 250 array.length = 50; 251 print("Array length after changed: " + array.length); 256 let array: SendableArray<number> = new SendableArray<number>(1, 3, 5); 257 array.push(2, 4, 6); 258 print("Elements pushed: " + array); 263 let array: SendableArray<number> = new SendableArray<number>(1, 3, 5); 267 print(array.concat(arkTSToAppend)); // [1, 3, 5, 2, 4, 6] 268 print(array.concat(arkTSToAppend, arkTSToAppend1)); [all …]
|
| D | expect_output.txt | 69 Array length: 3 70 Array length after changed: 3 143 Create with negative length failed. err: BusinessError: Parameter error.Invalid array length., code… 145 Create with exceed max length failed. err: BusinessError: Parameter error.Invalid array length., co… 151 Shrink to array.length: 5,5,5,5,5,5,5,5,5,5 152 Shrink to array.length + 1: 5,5,5,5,5,5,5,5,5,5 153 Shrink to -1 fail. err: BusinessError: Parameter error.Invalid array length., code: 401 154 Shrink to invalid 0x100000000 fail. err: BusinessError: Parameter error.Invalid array length., code… 159 ExtendTo to array.length: 5,5,5,5,5 160 ExtendTo to array.length - 1: 5,5,5,5,5 [all …]
|
| /arkcompiler/ets_frontend/test262/ |
| D | es2023_tests.txt | 1 built-ins/Array/prototype/findLast/predicate-call-parameters.js 2 built-ins/Array/prototype/findLast/return-abrupt-from-predicate-call.js 3 built-ins/Array/prototype/findLast/call-with-boolean.js 4 built-ins/Array/prototype/findLast/not-a-constructor.js 5 built-ins/Array/prototype/findLast/return-undefined-if-predicate-returns-false-value.js 6 built-ins/Array/prototype/findLast/length.js 7 built-ins/Array/prototype/findLast/return-abrupt-from-property.js 8 built-ins/Array/prototype/findLast/return-abrupt-from-this.js 9 built-ins/Array/prototype/findLast/return-abrupt-from-this-length-as-symbol.js 10 built-ins/Array/prototype/findLast/predicate-call-this-strict.js [all …]
|
| D | es2015_tests.txt | 1 built-ins/Array/15.4.5.1-5-1.js 2 built-ins/Array/15.4.5.1-5-2.js 3 built-ins/Array/15.4.5-1.js 4 built-ins/Array/constructor.js 5 built-ins/Array/from/Array.from_arity.js 6 built-ins/Array/from/Array.from_forwards-length-for-array-likes.js 7 built-ins/Array/from/Array.from-descriptor.js 8 built-ins/Array/from/Array.from-name.js 9 built-ins/Array/from/calling-from-valid-1-noStrict.js 10 built-ins/Array/from/calling-from-valid-1-onlyStrict.js [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/stdlib/escompat/ |
| D | Array.sts | 41 private parent: Array<T> 44 constructor(parent: Array<T>) { 64 * Represents JS API-compatible Array 66 export class Array<T> implements ReadonlyArray<T>, Iterable<T> { 113 * Creates a new instance of Array 135 * Creates a new instance of Array based on Object[] 137 * @param d Array initializer 151 * Creates a new instance of an Array with the specified length 153 * @param arrayLength The length of the array to be created (optional). 155 * @returns A new Array instance with the specified length [all …]
|
| /arkcompiler/ets_runtime/test/aottest/builtins_array/ |
| D | builtins_array.ts | 17 // test new builtin array 18 let array1 = new Array(); 19 let array2 = new Array(1); 25 print(Array().length); // c++ path 26 print(Array(1).length); // c++ path 29 let array3 = new Array(-1); 36 let array3 = new Array(2.1); 43 let array3 = new Array(4294967296); 58 let array = []; 59 for (let i = 0; i < 10; i++) array.push(i); [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/templates/stdlib/ |
| D | typedUArray.sts.j2 | 42 constructor(parent: {{element['name']}}Array) { 59 private parent: {{element['name']}}Array 62 constructor(parent: {{element['name']}}Array) { 81 private parent: {{element['name']}}Array 84 constructor(parent: {{element['name']}}Array) { 104 * JS {{element['name']}}Array API-compatible class 106 export class {{element['name']}}Array implements Iterable<{{element['subsetTypeValues']}}>, ArrayLi… 117 * Creates an empty {{element['name']}}Array. 124 … * Creates an {{element['name']}}Array with respect to data accessed via Iterable<Number> interface 128 … // with banned `instanceof` generic, so it is delegated to array here. Initial idea from Set.sts [all …]
|
| D | typedArray.sts.j2 | 40 constructor(parent: {{N}}Array) { 57 private parent: {{N}}Array 60 constructor(parent: {{N}}Array) { 79 private parent: {{N}}Array 82 constructor(parent: {{N}}Array) { 102 * JS {{N}}Array API-compatible class 104 export final class {{N}}Array implements Iterable<{{subsetTypeValues}}>, ArrayLike<{{subsetTypeValu… 109 * Creates an empty {{N}}Array. 116 * Creates an {{N}}Array with respect to data accessed via Iterable<Number> interface 120 … // with banned `instanceof` generic, so it is delegated to array here. Initial idea from Set.sts [all …]
|
| D | Array_escompat.erb | 24 private parent: Array<T> 27 constructor(parent: Array<T>) { 47 * Represents JS API-compatible Array 49 export class Array<T> implements ReadonlyArray<T>, Iterable<T> { 96 * Creates a new instance of Array 118 * Creates a new instance of Array based on Object[] 120 * @param d Array initializer 134 * Creates a new instance of an Array with the specified length 136 * @param arrayLength The length of the array to be created (optional). 138 * @returns A new Array instance with the specified length [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/ets_es_checked/ |
| D | array.yaml | 14 category: Array 17 … - Array.of<number>(0, -0.0, 4, 1, 2, -1, Infinity, 11, -Infinity, 1, 21, 111, NaN, -NaN, 0, -0.0) 18 - Array.of<number>(0, -0.0, 4, 1, 2, -1, 1, 21, 111, 0, -0.0) 19 - Array.of<number>() 20 self_type: Array<number> 35 (x: number, y: number, i: number, array: Array<number>): number => y - x + i + array[i] 46 (x: string, y: number, i: number, array: Array<number>): string => y + x + i + array[i] 50 …- combinationRest "Array.of<number>(1)", "Array.of<number>()", "Array.of<number>(NaN, 10, Infinity… 76 … Array.of<number>(0, -0.0, 4, 1, 2, -1, Infinity, 11, -Infinity, 1, 21, 111, NaN, -NaN, 0, -0.0) 85 ret_type: Array<number> [all …]
|
| /arkcompiler/ets_runtime/test/moduletest/arraysplice/ |
| D | arraysplice.js | 29 arr = new Array(100) 33 var array = new Array(10); 34 var spliced = array.splice(1, 1); 35 for (let i = 0; i < array.length; ++i) { 36 print(i in array) 38 var array1 = new Array(10); 44 array = []; 47 let bad_start = { valueOf: function () { array.push(2 * i); return -1; } }; 48 let bad_count = { valueOf: function () { array.push(2 * i + 1); return 1; } }; 49 spliced = array.splice(bad_start, bad_count); [all …]
|
| /arkcompiler/ets_runtime/ecmascript/builtins/ |
| D | builtins_array.h | 21 // List of functions in Array, excluding the '@@' properties. 23 // where BuiltinsArray::func refers to the native implementation of Array[name]. 26 /* Array.from ( items [ , mapfn [ , thisArg ] ] ) */ \ 28 /* Array.isArray ( arg ) */ \ 30 /* Array.of ( ...items ) */ \ 33 // List of functions in Array.prototype, excluding the constructor and '@@' properties. 35 // where BuiltinsArray::func refers to the native implementation of Array.prototype[name]. 37 /* Array.prototype.at ( index ) */ \ 39 /* Array.prototype.concat ( ...items ) */ \ 41 /* Array.prototype.copyWithin ( target, start [ , end ] ) */ \ [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/stdlib/std/core/ |
| D | BuiltinArray.sts | 43 // startIndex <= endIndex is used to cover empty array case 80 * from the last item in the array. 82 * @param index Zero-based index of the array element to be returned. 83 …* Negative index counts back from the end of the array — if `index` < 0, index + `array.length()` … 85 * @returns The element in the array matching the given index. 93 * Creates a new `Array` from this `Array` instance and given `Array` instance. 95 * @param other to concatenate into a new array. 97 …* @returns New `Array` instance, constructed from `this` and given `other` instances of `Array` cl… 130 * from the last item in the array. 132 * @param index Zero-based index of the array element to be returned. [all …]
|
| /arkcompiler/ets_runtime/test/moduletest/array/ |
| D | array.js | 17 * @tc.name:array 18 * @tc.desc:test Array 22 var arr = new Array(100); 30 var arr2 = new Array(100); 74 // Test on Array::Splice 75 var arr9 = new Array(9); 83 var arr10 = new Array(9); 91 var arr11 = new Array(9); 99 var arr12 = new Array(9); 107 var arr13 = new Array(9); [all …]
|
| /arkcompiler/ets_frontend/ets2panda/linter/test_extended_features/ |
| D | @arkts.collections.d.ets | 34 * Callback function used in the typed Array's 'from' function. 37 * @param { FromElementType } value - The value in the original array. 38 * @param { number } index - The index in the original array. 47 * Callback function used in typed Array functions which needs to determine 53 * @param { ArrayType } array - The array that the element belongs to. 61 (value: ElementType, index: number, array: ArrayType) => boolean; 63 * Callback function used in typed Array functions that perform specific action for each element. 68 * @param { ArrayType } array - The array that the element belongs to. 75 (value: ElementType, index: number, array: ArrayType) => void; 77 …* Callback function used in typed Array functions that perform specific action for each element and [all …]
|
| /arkcompiler/runtime_core/tests/cts-generator/cts-template/ |
| D | test-schema.json | 34 "type": "array", 40 "type": "array", 46 "type": "array", 52 "type": "array", 65 "type": "array", 82 "type": "array", 97 "type": "array", 110 "type": "array", 128 "type": "array", 134 "type": "array", [all …]
|
| /arkcompiler/runtime_core/static_core/tests/cts-generator/cts-template/ |
| D | test-schema.json | 34 "type": "array", 40 "type": "array", 46 "type": "array", 52 "type": "array", 65 "type": "array", 82 "type": "array", 97 "type": "array", 110 "type": "array", 128 "type": "array", 134 "type": "array", [all …]
|
| /arkcompiler/ets_runtime/test/aottest/ldobjbyname_typed_path/ |
| D | expect_output.txt | 14 Testing Array literal: 16 - Array.prototype.reverse: 9,8,7 17 - Array.prototype.shift: 9 18 Testing new Array(): 20 - Array.prototype.slice: 11,12,13 21 - Array.prototype.includes: true 53 Testing Array with prototype changed (via arr.__proto__): 55 Testing with Array.prototype.pop changed to another function: 56 - Array.prototype.pop: Array.prototype.pop changed to another function. 57 Testing with Array.prototype.pop changed to a string: [all …]
|
| /arkcompiler/runtime_core/static_core/plugins/ets/tests/mock/ |
| D | array_native_test.cpp | 74 ets_booleanArray array = env_->NewBooleanArray(src.size()); in TEST_F() local 75 ASSERT_NE(array, nullptr); in TEST_F() 77 ets_size length = env_->GetArrayLength(array); in TEST_F() 80 env_->SetBooleanArrayRegion(array, 0, src.size(), src.data()); in TEST_F() 83 ets_boolean *buf = env_->PinBooleanArray(array); in TEST_F() 89 env_->GetBooleanArrayRegion(array, 0, src.size(), res2.data()); in TEST_F() 92 env_->UnpinBooleanArray(array); in TEST_F() 97 env_->GetBooleanArrayRegion(array, 0, length, vec.data()); in TEST_F() 104 env_->GetBooleanArrayRegion(array, half, length - half, vec.data()); in TEST_F() 113 ets_byteArray array = env_->NewByteArray(src.size()); in TEST_F() local [all …]
|