• Home
  • Raw
  • Download

Lines Matching full:array

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));
269 print(array.concat(200));
270 print(array.concat(201, 202));
271 let arr: SendableArray<number> = array.concat(null);
275 let arr1: SendableArray<number> = array.concat(undefined);
303 const array = SendableArray.from<number>([1, 2, 3]); constant
304 print(array.unshift(4, 5));
305 print(array.length);
370 const array = new SendableArray<string>('a', 'b', 'c'); constant
371 array.forEach((element: string) => print(element)); // a <br/> b <br/> c
373 array.forEach((element: string, index: number, array: SendableArray<string>) =>
374 print(`a[${index}] = ${element}, ${array[index]}`),
380 const array = new SendableArray<number>(1, 4, 9, 16); constant
381 print(array.map<string>((x: number) => x + x));
395 …const result = array2.filter<SubClass>((value: SuperClass, index: number, obj: Array<SuperClass>) …
401 const array = new SendableArray<number>(1, 2, 3, 4); constant
402 print(array.reduce((acc: number, currValue: number) => acc + currValue)); // 10
404 print(array.reduce((acc: number, currValue: number) => acc + currValue, 10)); // 20
406 …print(array.reduce<string>((acc: number, currValue: number) => "" + acc + " " + currValue, "10"));…
426 const array = new SendableArray<string>('Jan', 'March', 'April', 'June'); constant
427 array.splice(1, 0, 'Feb', 'Oct');
428 print(array); // "Jan", "Feb", "Oct", "March", "April", "June"
429 const removeArray = array.splice(4, 2, 'May');
430 print(array); // "Jan", "Feb", "Oct", "March", "May"
432 const removeArray1 = array.splice(2, 3);
433 print(array); // "Jan", "Feb"
461 const array = SendableArray.create<number>(10, 5); constant
462 print(array);
464 const array = SendableArray.create<number>(5); constant
470 const array = SendableArray.create<number>(-1, 5); constant
476 const array = SendableArray.create<number>(13107200, 1); // 13107200: 12.5MB constant
482 const array = SendableArray.create<number>(0x100000000, 5); constant
491 const array = SendableArray.create<number>(10, 5); constant
492 print(array.length);
493 array.length = 0;
494 print(array.length);
499 const array = new SendableArray<number>(5, 5, 5, 5, 5, 5, 5, 5, 5, 5); constant
500 print(array.length);
501 array.shrinkTo(array.length);
502 print("Shrink to array.length: " + array);
503 array.shrinkTo(array.length + 1);
504 print("Shrink to array.length + 1: " + array);
506 array.shrinkTo(-1);
512 array.shrinkTo(0x100000000);
517 array.shrinkTo(1);
518 print(array.length);
519 print(array);
525 const array = SendableArray.create<number>(5, 5); constant
526 print(array.length);
527 array.extendTo(array.length, 0);
528 print("ExtendTo to array.length: " + array);
529 array.extendTo(array.length - 1, 0);
530 print("ExtendTo to array.length - 1: " + array);
531 array.extendTo(0, 0);
532 print("ExtendTo to 0: " + array);
534 array.extendTo(-1, 0);
540 array.extendTo(0x100000000, 0);
546 array.extendTo(8);
551 array.extendTo(8, 11);
552 print(array.length);
553 print(array);
558 const array = new SendableArray<number>(1, 3, 5, 7); constant
559 print("element1: " + array[1]);
560 array[1] = 10
561 print("element1 assigned to 10: " + array[1]);
563 array[10]
569 array[100] = 10
575 array.forEach((key: number, _: number, array: SendableArray) => {
576 array[key + array.length];
579 print("read element while iterate array fail. err: " + err + ", errCode: " + err.code);
582 array.forEach((key: number, _: number, array: SendableArray) => {
583 array[key + array.length] = 100;
586 print("write element while iterate array fail. err: " + err + ", errCode: " + err.code);
592 const array = new SendableArray<number>(1, 3, 5, 7); constant
593 print("String index element1: " + array["" + 1]);
594 array["" + 1] = 10
595 print("String index element1 assigned to 10: " + array["" + 1]);
597 array["" + 10]
603 array["" + 100] = 10
609 array.forEach((key: number, _: number, array: SendableArray) => {
610 array['' + key + array.length];
613 …print("String index read element while iterate array fail. err: " + err + ", errCode: " + err.code…
616 array.forEach((key: number, _: number, array: SendableArray) => {
617 array['' + key + array.length] = 100;
620 …print("String index write element while iterate array fail. err: " + err + ", errCode: " + err.cod…
625 const array = new SendableArray<number>(1, 3, 5, 7); constant
627 const element = array[index < 80 ? 1 : 10];
629 print("[IC] Index access read in range success. array: " + element);
637 array[index < 80 ? 1 : 100] = 10
647 array.length = index < 80 ? 1 : 100;
659 const array = new SendableArray<number>(1, 3, 5, 7); constant
661 const element = array["" + index < 80 ? 1 : 10];
663 print("[IC] String Index access read in range success. array: " + element);
671 array["" + (index < 80 ? 1 : 100)] = 10
682 function frozenTest(array: SendableArray) {
684 array.notExistProp = 1;
686 print('Add prop to array failed. err: ' + err);
689 Object.defineProperty(array, 'defineNotExistProp', { value: 321, writable: false });
691 print('defineNotExistProp to array failed. err: ' + err);
694 array.at = 1;
699 Object.defineProperty(array, 'at', { value: 321, writable: false });
703 array.push(111);
756 Array.from(map);
763 Array.from(mapper.values());
766 Array.from(mapper.keys());
780 …print('create from sharedMap with non-sendable array failed. err: ' + err + ', code: ' + err.code);
799 …print('Create array from notArray: ' + SendableArray.from.call(NotArray, new Set(['foo', 'bar', 'b…
801 print("Create array from notArray failed. err: " + err + ", code: " + err.code);
830 let array = new SubSharedClass();
831 array.push('March');
832 array.push('Jan');
833 array.push('Feb');
834 array.push('Dec');
835 array.forEach((element: string, index: number, array: SendableArray<string>) =>
836 print(`a[${index}] = ${element}, ${array instanceof SubSharedClass}`),
842 let array = new SubSharedClass();
843 array.push(1);
844 array.push(4);
845 array.push(9);
846 array.push(16);
847 …print("instanceOf derived map result: " + (array.map<string>((x: number) => x + x + "") instanceof…
852 let array = new SubSharedClass();
853 array.push(1);
854 array.push(2);
855 array.push(3);
856 array.push(4);
857 const filledArray = array.fill(0, 2, 4);
858 print(array); // [1, 2, 0, 0]
863 print("Start Test array read out of range")
864 const array = new SendableArray<number>(1, 3, 5, 7); constant
865 print("array[0]: " + array[0]);
867 let value = array[9];
874 let value = array['0'];
881 let value = array[0.0];
888 let value = array[1.5]
895 let value = array[undefined]
902 let value = array[null]
909 let value = array[Symbol.toStringTag]
916 let value = array[false]
923 let value = array[true]
931 print("Start Test array for of")
932 const array = new SendableArray<number>(1, 3, 5, 7); constant
933 for(const num of array){
945 … print("Create from SendableArray with non-sendable array error: " + new SendableArray(from_arr));
947 …print("Create from SendableArray with non-sendable array error failed. err: " + err + ", code: " +…
960 let array = new SendableArray<string>('ARK');
962 …Object.defineProperty(array, '0', {writable: true, configurable: true, enumerable: true, value: "3…
963 print('defineProperty to array success');
965 print('defineProperty to array failed. err: ' + err);
969 …Object.defineProperty(array, '1200', {writable: true, configurable: true, enumerable: true, value:…
970 print('defineProperty to array success');
972 print('defineProperty to array failed. err: ' + err);
976 …Object.defineProperty(array, 0, {writable: true, configurable: true, enumerable: true, value: "321…
977 print('defineProperty to array success');
979 print('defineProperty to array failed. err: ' + err);
983 …Object.defineProperty(array, 1200, {writable: true, configurable: true, enumerable: true, value: "…
984 print('defineProperty to array success');
986 print('defineProperty to array failed. err: ' + err);
990 …Object.defineProperty(array, 2871622679, {writable: true, configurable: true, enumerable: true, va…
991 print('defineProperty to array success');
993 print('defineProperty to array failed. err: ' + err);
996 …Object.defineProperty(array, 0.0, {writable: true, configurable: true, enumerable: true, value: "3…
997 print('defineProperty to array success ' + array[0.0]);
999 print("defineProperty to array failed. err: " + err + ", code: " + err.code);
1003 …Object.defineProperty(array, 1.5, {writable: true, configurable: true, enumerable: true, value: "3…
1004 print('defineProperty to array success ' + array[1.5]);
1006 print("defineProperty to array failed. err: " + err + ", code: " + err.code);
1010 …Object.defineProperty(array, undefined, {writable: true, configurable: true, enumerable: true, val…
1011 print("defineProperty to array success " + array[undefined]);
1013 print("defineProperty to array failed. err: " + err + ", code: " + err.code);
1017 …Object.defineProperty(array, null, {writable: true, configurable: true, enumerable: true, value: "…
1018 print("defineProperty to array success " + array[null]);
1020 print("defineProperty to array failed. err: " + err + ", code: " + err.code);
1024 …Object.defineProperty(array, Symbol.toStringTag, {writable: true, configurable: true, enumerable: …
1025 print("defineProperty to array success " + array[Symbol.toStringTag]);
1027 print("defineProperty to array failed. err: " + err + ", code: " + err.code);
1031 …Object.defineProperty(array, true, {writable: true, configurable: true, enumerable: true, value: "…
1032 print("defineProperty to array success " + array[null]);
1034 print("defineProperty to array failed. err: " + err + ", code: " + err.code);
1038 …Object.defineProperty(array, false, {writable: true, configurable: true, enumerable: true, value: …
1039 print("defineProperty to array success " + array[Symbol.toStringTag]);
1041 print("defineProperty to array failed. err: " + err + ", code: " + err.code);