/arkcompiler/ets_runtime/test/typeinfer/automatedcases/ |
D | typedArraysSubarray.ts | 22 let arr = new Int8Array(10); 23 AssertType(arr, "Int8Array"); 28 arr.subarray(); 29 AssertType(arr.subarray(), "Int8Array"); 30 AssertType(arr.subarray, "(?number, ?number) => Int8Array"); 32 arr.subarray(0); 33 AssertType(arr.subarray(0), "Int8Array"); 34 AssertType(arr.subarray, "(?number, ?number) => Int8Array"); 37 arr.subarray(0, 10); 38 AssertType(arr.subarray(0, 10), "Int8Array"); [all …]
|
D | privateNameMethodCallExpression.ts | 50 const arr = [ 1, 2 ]; constant 51 AssertType(arr, "number[]"); 56 this.#method2(0, ...arr, 3); 57 AssertType(this.#method2(0, ...arr, 3), "void"); 61 AssertType(...arr, "number"); 62 AssertType(arr, "number[]"); 65 const b = new this.#method2(0, ...arr, 3); //Error 67 AssertType(new this.#method2(0, ...arr, 3), "any"); 71 AssertType(...arr, "number"); 72 AssertType(arr, "number[]"); [all …]
|
D | privateNameStaticMethodCallExpression.ts | 47 const arr = [ 1, 2 ]; constant 48 AssertType(arr, "number[]"); 53 AA.#method2(0, ...arr, 3); 54 AssertType(AA.#method2(0, ...arr, 3), "void"); 57 AssertType(...arr, "number"); 58 AssertType(arr, "number[]"); 61 const b = new AA.#method2(0, ...arr, 3); //Error 63 AssertType(new AA.#method2(0, ...arr, 3), "any"); 66 AssertType(...arr, "number"); 67 AssertType(arr, "number[]"); [all …]
|
D | unionWithIndexSignature.ts | 30 export function foo<T extends NumList | StrList>(arr: T & (NumList | StrList)) { 31 let zz = arr[1]; // Error 33 AssertType(arr[1], "union"); 34 AssertType(arr, "union"); 53 export function flatten<T extends number|TypedArray>(arr: T) { 54 if (isTypedArray(arr)) { 55 AssertType(isTypedArray(arr), "boolean"); 57 AssertType(arr, "union"); 59 arr[1]; 60 AssertType(arr[1], "number"); [all …]
|
D | nullishCoalescingOperator12.ts | 21 const obj: { arr: any[] } = { arr: [] }; 23 AssertType(arr, "any[]"); 24 AssertType({ arr: [] }, "{ arr: never[]; }"); 25 AssertType(arr, "never[]"); 28 for (const i of obj?.arr ?? []) { }
|
D | mixedPropertyElementAccessAssignmentDeclaration.ts | 22 let arr = []; 23 AssertType(arr, "any[]"); 26 arr[0].prop[2] = {}; 27 AssertType(arr[0].prop[2] = {}, "{}"); 28 AssertType(arr[0].prop[2], "any"); 29 AssertType(arr[0].prop, "any");
|
D | privateNameFieldCallExpression.ts | 55 const arr = [ 1, 2 ]; constant 56 AssertType(arr, "number[]"); 61 this.#fieldFunc2(0, ...arr, 3); 62 AssertType(this.#fieldFunc2(0, ...arr, 3), "void"); 66 AssertType(...arr, "number"); 67 AssertType(arr, "number[]"); 70 const b = new this.#fieldFunc2(0, ...arr, 3); 72 AssertType(new this.#fieldFunc2(0, ...arr, 3), "any"); 76 AssertType(...arr, "number"); 77 AssertType(arr, "number[]");
|
D | privateNameAccessorsCallExpression.ts | 65 const arr = [ 1, 2 ]; constant 66 AssertType(arr, "number[]"); 71 this.#fieldFunc2(0, ...arr, 3); 72 AssertType(this.#fieldFunc2(0, ...arr, 3), "void"); 76 AssertType(...arr, "number"); 77 AssertType(arr, "number[]"); 80 const b = new this.#fieldFunc2(0, ...arr, 3); 82 AssertType(new this.#fieldFunc2(0, ...arr, 3), "any"); 86 AssertType(...arr, "number"); 87 AssertType(arr, "number[]");
|
D | privateNameStaticAccessorsCallExpression.ts | 63 const arr = [ 1, 2 ]; constant 64 AssertType(arr, "number[]"); 69 this.#fieldFunc2(0, ...arr, 3); 70 AssertType(this.#fieldFunc2(0, ...arr, 3), "void"); 74 AssertType(...arr, "number"); 75 AssertType(arr, "number[]"); 78 const b = new this.#fieldFunc2(0, ...arr, 3); 80 AssertType(new this.#fieldFunc2(0, ...arr, 3), "any"); 84 AssertType(...arr, "number"); 85 AssertType(arr, "number[]");
|
D | privateNameStaticFieldCallExpression.ts | 51 const arr = [ 1, 2 ]; constant 52 AssertType(arr, "number[]"); 57 A.#fieldFunc2(0, ...arr, 3); 58 AssertType(A.#fieldFunc2(0, ...arr, 3), "void"); 61 AssertType(...arr, "number"); 62 AssertType(arr, "number[]"); 65 const b = new A.#fieldFunc2(0, ...arr, 3); 67 AssertType(new A.#fieldFunc2(0, ...arr, 3), "any"); 70 AssertType(...arr, "number"); 71 AssertType(arr, "number[]");
|
D | restTypeRetainsMappyness.ts | 26 const arr: Foo<T> = {} as any constant 27 AssertType(arr, "Foo<T>"); 31 fn(...arr) // Error: Argument of type 'any[]' is not assignable to parameter of type 'Foo<T>' 32 AssertType(fn(...arr), "void"); 34 AssertType(...arr, "any"); 35 AssertType(arr, "Foo<T>");
|
D | arrayLiteralContextualType.ts | 67 let arr = [new Giraffe(), new Elephant()]; variable 68 AssertType(arr, "(union)[]"); 75 foo(arr); // ok because arr is Array<Giraffe|Elephant> not {}[] 76 AssertType(foo(arr), "void"); 78 AssertType(arr, "(union)[]"); 80 bar(arr); // ok because arr is Array<Giraffe|Elephant> not {}[] 81 AssertType(bar(arr), "void"); 83 AssertType(arr, "(union)[]");
|
D | arraySlice.ts | 21 let arr: string[] | number[]; 22 AssertType(arr, "union"); 24 arr.splice(1, 1); 25 AssertType(arr.splice(1, 1), "union"); 26 AssertType(arr.splice, "union");
|
D | classDeclarationLoop.ts | 21 const arr = []; 22 AssertType(arr, "any[]"); 29 arr.push(C); 30 AssertType(arr.push(C), "number"); 31 AssertType(arr.push, "(...any[]) => number");
|
D | classExpressionLoop.ts | 21 let arr = []; 22 AssertType(arr, "any[]"); 26 arr.push(class C { 27 AssertType(arr.push(class C { prop = i; }), "number"); 28 AssertType(arr.push, "(...any[]) => number");
|
/arkcompiler/ets_runtime/test/moduletest/regexp/ |
D | regexp.js | 54 let arr = [] variable 57 arr.push(quotedEmailUserUtf8.test(" foo m端ller ")) 60 arr.push(reg8.test('palíndromo')) 61 arr.push(reg8.test('órgão')) 62 arr.push(reg8.test('qwértyúão')) 63 arr.push(reg8.test('àäãcëüïÄÏÜ')) 66 arr.push(reg9.test('àéèìîóòù')) 67 arr.push(reg9.test('metró')) 68 arr.push(reg9.test('pèsca')) 69 arr.push(reg9.test('genî')) [all …]
|
/arkcompiler/runtime_core/compiler/tests/ |
D | encoder_operands.cpp | 45 TypeInfo arr[] = { in TEST() local 66 for (uint8_t i = 0; i < sizeof(arr) / sizeof(TypeInfo); ++i) { in TEST() 68 ASSERT_FALSE(arr[i].IsValid()); in TEST() 70 ASSERT_TRUE(arr[i].IsValid()); in TEST() 75 ASSERT_EQ(arr[i], arr[4 + i]); in TEST() 76 ASSERT_EQ(arr[i], arr[8 + i]); in TEST() 77 ASSERT_EQ(arr[4 + i], arr[8 + i]); in TEST() 79 ASSERT_EQ(arr[i].GetSize(), arr[4 + i].GetSize()); in TEST() 80 ASSERT_EQ(arr[i].GetSize(), arr[8 + i].GetSize()); in TEST() 81 ASSERT_EQ(arr[4 + i].GetSize(), arr[8 + i].GetSize()); in TEST() [all …]
|
/arkcompiler/ets_runtime/test/typeinfer/builtins/ |
D | builtins.ts | 136 let arr = new Array(); 137 AssertType(arr.length, "int"); 138 AssertType(arr.concat([1, 2, 3]), "any[]"); 139 AssertType(arr.copyWithin(0, 1), "Array"); 140 AssertType(arr.entries(), "interface"); 141 AssertType(arr.every((v: any, i: number, arr: any[]) => { }), "boolean"); 142 AssertType(arr.fill(1), "Array"); 143 AssertType(arr.filter((v: any, i: number, arr: any[]) => { }), "any[]"); 144 AssertType(arr.findIndex((v: any, i: number, arr: any[]) => { }), "number"); 145 AssertType(arr.forEach((v: any, i: number, arr: any[]) => { }), "void"); [all …]
|
/arkcompiler/ets_runtime/test/aottest/aot_type_test/arraylength/ |
D | arraylength.ts | 17 let arr: number[] = [1, 2, 3]; 18 print(arr.length); 19 arr.push(4); 20 print(arr.length); 21 arr.pop(); 22 print(arr.length); 24 Object.defineProperty(arr, "x", { value: 123 }); 25 print(arr.length); // occur deopt
|
/arkcompiler/ets_frontend/arkguard/test/ut/utils/ |
D | ListUtil.spec.ts | 23 let arr = ListUtil.getInitList(-1); variable 24 assert.isTrue(arr.length === 0); 28 let arr = ListUtil.getInitList(0); variable 29 assert.isTrue(arr.length === 0); 33 let arr = ListUtil.getInitList(NaN); variable 34 assert.isTrue(arr.length === 0); 38 let arr = ListUtil.getInitList(ListUtil.MAX_INIT_LEN); variable 39 assert.isTrue(arr.length === ListUtil.MAX_INIT_LEN); 43 let arr = ListUtil.getInitList(ListUtil.MAX_INIT_LEN + 1); variable 44 assert.isTrue(arr.length === 0); [all …]
|
/arkcompiler/ets_frontend/arkguard/test/ut/ |
D | NameGenerator.spec.ts | 48 let arr = [] variable 50 arr.push(disorderGenerator.getName()); 56 const sliceArr = arr.slice(26 * (i - 1), 26 * i); 68 const downConsecutive = (arr[i - 2].charCodeAt(0) - arr[i - 1].charCodeAt(0) === 1) && 69 (arr[i - 1].charCodeAt(0) - arr[i].charCodeAt(0) === 1); 74 const upConsecutive = (arr[i].charCodeAt(0) - arr[i - 1].charCodeAt(0) === 1) && 75 (arr[i - 1].charCodeAt(0) - arr[i - 2].charCodeAt(0) === 1); 206 let arr = []; variable 210 arr.push(nameGet); 213 arr.forEach(((value, index) => { [all …]
|
/arkcompiler/ets_frontend/arkguard/test/grammar/array_validation/ |
D | array_fill.ts | 18 var arr = [0, 1, 2, 3, 4, 5]; variable 20 arr.fill(3, 1, 5); 22 assert(arr[1] === 3, 'success'); 24 assert(arr[2] === 3, 'success'); 26 assert(arr[3] === 3, 'success'); 28 assert(arr[4] === 3, 'success');
|
/arkcompiler/ets_runtime/test/aottest/ts_inline_deopt/ |
D | ts_inline_deopt.ts | 41 let arr = new Array(2) variable 42 arr[0] = 1 45 arr[1] = str 46 print(arr.length) 47 print(arr[0]) 48 print(arr[1])
|
/arkcompiler/ets_runtime/test/moduletest/equal/ |
D | equal.js | 22 var arr = [null, undefined, 0, "", 0n, false, Symbol(0), []]; variable 23 for (let i = 0; i < arr.length; i++) { 24 for (let j = 0; j < arr.length; j++){ 25 print(arr[i] == arr[j]);
|
/arkcompiler/ets_runtime/test/typeinfer/es2abc_feature/arrow_function_in_foreach/ |
D | arrow_function_in_foreach.ts | 29 d.b1.forEach((value, index, arr)=>{ 32 AssertType(arr, "A[]"); 33 let e = arr[index].a1 + value.a1; 50 f.forEach((value, index, arr)=>{ 53 AssertType(arr, "number[]"); 54 return value + arr[index];})
|