Lines Matching full:a
5 * You may obtain a copy of the License at
33 let a = [1, 2, 34];
34 if (a[0] == 1 && a[1] == 2 && a[2] == 34 && ArkTools.getElementsKind(a) == PACKEDINT) {
44 let a = [1, 2, 34];
45 a[1] = 10;
46 if (a[0] == 1 && a[1] == 10 && a[2] == 34 && ArkTools.getElementsKind(a) == PACKEDINT) {
57 let a = [1, 2, 34];
58 print(a[10]); // deopt point
59 if (a[0] == 1 && a[1] == 2 && a[2] == 34 && ArkTools.getElementsKind(a) == PACKEDINT) {
70 let a = [1, 2, 34];
71 print(a[10]); // deopt point
72 a[1] = 10;
73 if (a[0] == 1 && a[1] == 10 && a[2] == 34 && ArkTools.getElementsKind(a) == PACKEDINT) {
83 let a = [1.5, 3.5, 6.7];
84 if (a[0] == 1.5 && a[1] == 3.5 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
94 let a = [1.5, 3.5, 6.7];
95 a[1] = 8.8;
96 if (a[0] == 1.5 && a[1] == 8.8 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
107 let a = [1.5, 3.5, 6.7];
108 print(a[10]); // deopt point
109 if (a[0] == 1.5 && a[1] == 3.5 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
120 let a = [1.5, 3.5, 6.7];
121 print(a[10]); // deopt point
122 a[1] = 8.8;
123 if (a[0] == 1.5 && a[1] == 8.8 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
133 let a = [1.5, 3, 6.7];
134 if (a[0] == 1.5 && a[1] == 3 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
144 let a = [1.5, 3, 6.7];
145 a[0] = 2;
146 if (a[0] == 2 && a[1] == 3 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
157 let a = [1.5, 3, 6.7];
158 print(a[10]);
159 if (a[0] == 1.5 && a[1] == 3 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
170 let a = [1.5, 3, 6.7];
171 print(a[10]);
172 a[0] = 2;
173 if (a[0] == 2 && a[1] == 3 && a[2] == 6.7 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
183 let a = ["o", "p", "q"];
184 if (a[0] == "o" && a[1] == "p" && a[2] == "q" && ArkTools.getElementsKind(a) == PACKEDSTRING) {
194 let a = ["o", "p", "q"];
195 a[0] = "x";
196 if (a[0] == "x" && a[1] == "p" && a[2] == "q" && ArkTools.getElementsKind(a) == PACKEDSTRING) {
207 let a = ["o", "p", "q"];
208 print(a[10]);
209 if (a[0] == "o" && a[1] == "p" && a[2] == "q" && ArkTools.getElementsKind(a) == PACKEDSTRING) {
220 let a = ["o", "p", "q"];
221 print(a[10]);
222 a[0] = "x";
223 if (a[0] == "x" && a[1] == "p" && a[2] == "q" && ArkTools.getElementsKind(a) == PACKEDSTRING) {
233 let a = [1, , 5];
234 if (a[0] == 1 && a[1] == undefined && a[2] == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
244 let a = [1.5, , 5.6];
245 …if (a[0] == 1.5 && a[1] == undefined && a[2] == 5.6 && ArkTools.getElementsKind(a) == HOLENUMBER) {
256 let a = [1, , 5];
257 print(a[10]);
258 if (a[0] == 1 && a[1] == undefined && a[2] == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
269 let a = [1.5, , 5.6];
270 print(a[10]);
271 …if (a[0] == 1.5 && a[1] == undefined && a[2] == 5.6 && ArkTools.getElementsKind(a) == HOLENUMBER) {
281 let a = [1, , 5];
282 a[0] = 2;
283 if (a[0] == 2 && a[1] == undefined && a[2] == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
293 let a = [1.5, , 5.6];
294 a[0] = 2.2;
295 …if (a[0] == 2.2 && a[1] == undefined && a[2] == 5.6 && ArkTools.getElementsKind(a) == HOLENUMBER) {
306 let a = [1, , 5];
307 print(a[10]);
308 a[0] = 2;
309 if (a[0] == 2 && a[1] == undefined && a[2] == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
320 let a = [1.5, , 5.6];
321 print(a[10]);
322 a[0] = 2.2;
323 …if (a[0] == 2.2 && a[1] == undefined && a[2] == 5.6 && ArkTools.getElementsKind(a) == HOLENUMBER) {
333 let a = [1, , 5];
334 if (a[1] != undefined) {
335 print("test25 - failed: a[1] should be undefined");
338 a[1] = 2;
339 if (a[1] != 2) {
342 if (a[0] == 1 && a[1] == 2 && a[2] == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
352 let a = [1.5, , 5.6];
353 if (a[1] != undefined) {
354 print("test26 - failed: a[1] should be undefined");
357 a[1] = 2.2;
358 if (a[1] != 2.2) {
361 if (a[0] == 1.5 && a[1] == 2.2 && a[2] == 5.6 && ArkTools.getElementsKind(a) == HOLENUMBER) {
372 let a = [1, , 5];
373 if (a[1] != undefined) {
374 print("test27 - failed: a[1] should be undefined");
377 a[1] = 2;
378 print(a[10]);
379 if (a[1] != 2) {
382 if (a[0] == 1 && a[1] == 2 && a[2] == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
393 let a = [1.5, , 5.6];
394 if (a[1] != undefined) {
395 print("test28 - failed: a[1] should be undefined");
398 a[1] = 2.2;
399 print(a[10]);
400 if (a[1] != 2.2) {
403 if (a[0] == 1.5 && a[1] == 2.2 && a[2] == 5.6 && ArkTools.getElementsKind(a) == HOLENUMBER) {
413 let a = [1, , 5.1];
414 … if (a[0] == 1 && a[1] == undefined && a[2] == 5.1 && ArkTools.getElementsKind(a) == HOLENUMBER) {
424 let a = ["o", , "q"];
425 …if (a[0] == "o" && a[1] == undefined && a[2] == "q" && ArkTools.getElementsKind(a) == HOLESTRING) {
436 let a = [1, , 5.1];
437 print(a[10]);
438 … if (a[0] == 1 && a[1] == undefined && a[2] == 5.1 && ArkTools.getElementsKind(a) == HOLENUMBER) {
449 let a = ["o", , "q"];
450 print(a[10]);
451 …if (a[0] == "o" && a[1] == undefined && a[2] == "q" && ArkTools.getElementsKind(a) == HOLESTRING) {
461 let a = [1, , 5.1];
462 a[0] = 2;
463 … if (a[0] == 2 && a[1] == undefined && a[2] == 5.1 && ArkTools.getElementsKind(a) == HOLENUMBER) {
473 let a = ["o", , "q"];
474 a[0] = "x";
475 …if (a[0] == "x" && a[1] == undefined && a[2] == "q" && ArkTools.getElementsKind(a) == HOLESTRING) {
486 let a = [1, , 5.1];
487 print(a[10]);
488 a[0] = 2;
489 … if (a[0] == 2 && a[1] == undefined && a[2] == 5.1 && ArkTools.getElementsKind(a) == HOLENUMBER) {
500 let a = ["o", , "q"];
501 print(a[10]);
502 a[0] = "x";
503 …if (a[0] == "x" && a[1] == undefined && a[2] == "q" && ArkTools.getElementsKind(a) == HOLESTRING) {
513 let a = [1, , 5.6];
514 if (a[1] != undefined) {
515 print("test37 - failed: a[1] should be undefined");
518 a[1] = 2;
519 if (a[1] != 2) {
522 if (a[0] == 1 && a[1] == 2 && a[2] == 5.6 && ArkTools.getElementsKind(a) == HOLENUMBER) {
532 let a = ["o", , "q"];
533 if (a[1] != undefined) {
534 print("test38 - failed: a[1] should be undefined");
537 a[1] = "p";
538 if (a[1] != "p") {
541 if (a[0] == "o" && a[1] == "p" && a[2] == "q" && ArkTools.getElementsKind(a) == HOLESTRING) {
552 let a = [1, , 5.1];
553 if (a[1] != undefined) {
554 print("test39 - failed: a[1] should be undefined");
557 a[1] = 2;
558 print(a[10]);
559 if (a[1] != 2) {
562 if (a[0] == 1 && a[1] == 2 && a[2] == 5.1 && ArkTools.getElementsKind(a) == HOLENUMBER) {
573 let a = ["o", , "q"];
574 if (a[1] != undefined) {
575 print("test40 - failed: a[1] should be undefined");
578 a[1] = "p";
579 print(a[10]);
580 if (a[1] != "p") {
583 if (a[0] == "o" && a[1] == "p" && a[2] == "q" && ArkTools.getElementsKind(a) == HOLESTRING) {
593 let a = [1, 2, 3];
594 if (a[0] != 1 || a[1] != 2 || a[2] != 3) {
597 a[1] = 2.5;
598 if (a[0] == 1 && a[1] == 2.5 && a[2] == 3 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
607 let a = [1, 2, 3];
608 a[1] = 2.5;
609 if (a[0] == 1 && a[1] == 2.5 && a[2] == 3 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
619 let a = [1, 2, 3];
620 a[0] = 4;
621 a[1] = 2.5;
622 if (a[0] == 4 && a[1] == 2.5 && a[2] == 3 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
632 let a = [1, 2, 3];
633 if (a[0] != 1 || a[1] != 2 || a[2] != 3) {
636 a[1] = "1";
637 if (a[0] == 1 && a[1] == "1" && a[2] == 3 && ArkTools.getElementsKind(a) == PACKEDTAGGED) {
646 let a = [1, 2.2, 3];
647 if (a[0] != 1 || a[1] != 2.2 || a[2] != 3) {
650 a[1] = 2;
651 if (a[0] == 1 && a[1] == 2 && a[2] == 3 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
660 let a = [1, 2.2, 3];
661 if (a[0] != 1 || a[1] != 2.2 || a[2] != 3) {
664 a[1] = "2";
665 if (a[0] == 1 && a[1] == "2" && a[2] == 3 && ArkTools.getElementsKind(a) == PACKEDTAGGED) {
674 let a = [1, 2, 3];
675 if (a[0] != 1 || a[1] != 2 || a[2] != 3) {
678 a[1] = "2";
679 if (a[0] == 1 && a[1] == "2" && a[2] == 3 && ArkTools.getElementsKind(a) == PACKEDTAGGED) {
690 let a = [1, "2"];
691 if (a[0] != 1 || a[1] != "2") {
694 a[1] = 2;
695 if (a[0] == 1 && a[1] == 2 && ArkTools.getElementsKind(a) == PACKEDTAGGED) {
704 let a = [1, "2"];
705 if (a[0] != 1 || a[1] != "2") {
708 a[0] = "1";
709 if (a[0] == "1" && a[1] == "2" && ArkTools.getElementsKind(a) == PACKEDTAGGED) {
719 let a = [1, , 3]
720 if (a[0] != 1 || a[1] != undefined || a[2] != 3) {
723 a[0] = "1";
724 if (a[0] == "1" && a[1] == undefined && a[2] == 3 && ArkTools.getElementsKind(a) == GENERIC) {
734 let a = [1, , 3]
735 a[0] = "1";
736 if (a[0] == "1" && a[1] == undefined && a[2] == 3 && ArkTools.getElementsKind(a) == GENERIC) {
746 let a = [1, , 3]
747 if (a[0] != 1 || a[1] != undefined || a[2] != 3) {
750 a[0] = 2.2;
751 … if (a[0] == 2.2 && a[1] == undefined && a[2] == 3 && ArkTools.getElementsKind(a) == HOLENUMBER) {
761 let a = [1, , 3]
762 a[0] = 2.2;
763 … if (a[0] == 2.2 && a[1] == undefined && a[2] == 3 && ArkTools.getElementsKind(a) == HOLENUMBER) {
773 let a = [1.1, , 3.3]
774 if (a[0] != 1.1 || a[1] != undefined || a[2] != 3.3) {
777 a[0] = "1";
778 if (a[0] == "1" && a[1] == undefined && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
788 let a = [1.1, , 3.3]
789 a[0] = "1";
790 if (a[0] == "1" && a[1] == undefined && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
800 let a = [1, , 3.3]
801 if (a[0] != 1 || a[1] != undefined || a[2] != 3.3) {
804 a[0] = "1";
805 if (a[0] == "1" && a[1] == undefined && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
815 let a = [1, , 3.3]
816 a[0] = "1";
817 if (a[0] == "1" && a[1] == undefined && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
828 let a = [1, , 3]
829 if (a[0] != 1 || a[1] != undefined || a[2] != 3) {
832 a[1] = 2.2;
833 if (a[0] == 1 && a[1] == 2.2 && a[2] == 3 && ArkTools.getElementsKind(a) == HOLENUMBER) {
844 let a = [1, , 3]
845 a[1] = 2.2;
846 if (a[0] == 1 && a[1] == 2.2 && a[2] == 3 && ArkTools.getElementsKind(a) == HOLENUMBER) {
857 let a = [1, , 3]
858 if (a[0] != 1 || a[1] != undefined || a[2] != 3) {
861 a[1] = "2";
862 if (a[0] == 1 && a[1] == "2" && a[2] == 3 && ArkTools.getElementsKind(a) == GENERIC) {
873 let a = [1, , 3]
874 a[1] = "2";
875 if (a[0] == 1 && a[1] == "2" && a[2] == 3 && ArkTools.getElementsKind(a) == GENERIC) {
886 let a = [1.1, , 3.3]
887 if (a[0] != 1.1 || a[1] != undefined || a[2] != 3.3) {
890 a[1] = 2;
891 if (a[0] == 1.1 && a[1] == 2 && a[2] == 3.3 && ArkTools.getElementsKind(a) == HOLENUMBER) {
902 let a = [1.1, , 3.3]
903 a[1] = 2;
904 if (a[0] == 1.1 && a[1] == 2 && a[2] == 3.3 && ArkTools.getElementsKind(a) == HOLENUMBER) {
915 let a = [1.1, , 3.3]
916 if (a[0] != 1.1 || a[1] != undefined || a[2] != 3.3) {
919 a[1] = "2";
920 if (a[0] == 1.1 && a[1] == "2" && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
931 let a = [1.1, , 3.3]
932 a[1] = "2";
933 if (a[0] == 1.1 && a[1] == "2" && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
944 let a = [1, , 3.3]
945 if (a[0] != 1 || a[1] != undefined || a[2] != 3.3) {
948 a[1] = "2";
949 if (a[0] == 1 && a[1] == "2" && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
960 let a = [1, , 3.3]
961 a[1] = "2";
962 if (a[0] == 1 && a[1] == "2" && a[2] == 3.3 && ArkTools.getElementsKind(a) == GENERIC) {
973 let a = [1, , "3"];
974 if (a[0] != 1 || a[1] != undefined || a[2] != "3") {
977 a[0] = "1";
978 a[1] = "2";
979 if (a[0] == "1" && a[1] == "2" && a[2] == "3" && ArkTools.getElementsKind(a) == GENERIC) {
990 let a = [1, , "3"];
991 a[0] = "1";
992 a[1] = "2";
993 if (a[0] == "1" && a[1] == "2" && a[2] == "3" && ArkTools.getElementsKind(a) == GENERIC) {
1003 let a = [1, 2, 3];
1004 let result = "Output: " + a;
1016 let a = [1.1, 2.2, 3.3];
1017 let result = "Output: " + a;
1029 let a = [1, 2.2, 3.3];
1030 let result = "Output: " + a;
1042 let a = [1, , 3];
1043 let result = "Output: " + a;
1055 let a = [1.1, , 3.3];
1056 let result = "Output: " + a;
1068 let a = [1, , 3.3];
1069 let result = "Output: " + a;
1081 let a = [1, 2, 3];
1082 a[1] = 2.2;
1083 let result = "Output: " + a;
1095 let a = [1, 2, 3];
1096 a[1] = "2";
1097 let result = "Output: " + a;
1109 let a = [1.1, 2.2, 3.3];
1110 a[1] = "2.2";
1111 let result = "Output: " + a;
1123 let a = [1, 2.2, 3.3];
1124 a[1] = "2";
1125 let result = "Output: " + a;
1137 let a = [1, , 3];
1138 a[1] = 2;
1139 let result = "Output: " + a;
1151 let a = [1, , 3.3];
1152 a[1] = 2.2;
1153 let result = "Output: " + a;
1165 let a = ["1", "2", "3"];
1166 let result = "Output: " + a;
1178 let a = ["1", , "3"];
1179 a[1] = "2";
1180 let result = "Output: " + a;
1191 let a = new Array(5);
1192 if (ArkTools.getElementsKind(a) == NONE) {
1200 let a = new Array(1, 2, 3);
1201 if (ArkTools.getElementsKind(a) == PACKEDINT) {
1209 let a = new Array(1, 1.5, 3);
1210 if (ArkTools.getElementsKind(a) == PACKEDNUMBER) {
1218 let a = new Array("1", 1.5, 3);
1219 if (ArkTools.getElementsKind(a) == PACKEDTAGGED) {
1227 let a = new Array("1", "2", "3");
1228 if (ArkTools.getElementsKind(a) == PACKEDSTRING) {
1236 let a = Array.of(1, 2, 3);
1237 if (a.length == 3 && ArkTools.getElementsKind(a) == PACKEDINT) {
1245 let a = Array.of(3);
1246 if (a.length == 1 && ArkTools.getElementsKind(a) == PACKEDINT) {
1261 let a = Array.of.call(NotArray, 1, 2, 3);
1262 if (result == 3 && a.length == 3 && ArkTools.getElementsKind(a) == GENERIC) {
1274 const a = num1.concat(num2);
1275 if (a.length == 6 && ArkTools.getElementsKind(a) == PACKEDINT) {
1286 const a = num1.concat(num2);
1287 if (a.length == 6 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
1295 let a = [1, , 3].concat([4, 5]); // [1, empty, 3, 4, 5]
1296 if (a.length == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
1304 let a = [1, , 3].concat([4, 5]); // [1, empty, 3, 4, 5]
1305 if (a.length == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
1315 let a = [0].concat(obj1, obj2);
1316 if (a.length == 5 && ArkTools.getElementsKind(a) == PACKEDTAGGED) {
1325 let a = [1, 2, 3, 4, 5].copyWithin(0, 3); // [4, 5, 3, 4, 5]
1326 if (a.length == 5 && ArkTools.getElementsKind(a) == PACKEDINT) {
1334 let a = [1, , 3].copyWithin(2, 1, 2); // [1, empty, empty]
1335 if (a.length == 3 && ArkTools.getElementsKind(a) == DICTIONARY) {
1344 const a = ["a", "b", "c"];
1347 for (const [index, element] of a.entries()) {
1348 if (element != a[i]) {
1423 0: "a",
1426 3: "a", // ignored by filter() since length is 3
1429 // [ 'a', 'b' ]
1690 // Pass a function to map
1704 // Pass a function to map
1729 const a = [1, 2, 3, 4, 5.5];
1730 let popResult = a.pop();
1732 if (popResult == 5.5 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
1741 let a = [6, 5, 4, 3, 2, 1];
1742 let b = a.toSorted();
1752 let a = [0, 1, 2];
1753 a.unshift(-1);
1754 if (a.length == 4 && ArkTools.getElementsKind(a) == PACKEDINT) {
1757 … print("test127 - failed, expected: " + PACKEDINT + " , but get: " + ArkTools.getElementsKind(a));
1762 let a = [0, 1, 2];
1763 a.unshift(-2, -1);
1764 if (a.length == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
1767 … print("test128 - failed, expected: " + HOLEINT + " , but get: " + ArkTools.getElementsKind(a));
1773 let a = [0, 1, 2, 3, 4, 5, 6];
1774 let b = a.toSpliced(2, 2, 3, 3);
1784 let a = [0, 1, 2, , 4, 5, 6];
1785 let b = a.toSpliced(2, 1, 3);
1795 let a = [0, 1, 2, 3, 4, 5, 6];
1796 let b = a.toSpliced(2, 1, 3.1);
1806 let a = [0, 1, 2, 4, 5, 6];
1807 let b = a.toReversed();
1817 let a = [0, 1, 2, , 4, 5, 6];
1818 let b = a.toReversed();
1828 let a = [0, 1, 2, ,4, 5, 6];
1829 if (a.length == 7 && a.at(2) == 2 && a.at(3) == undefined) {
1832 print("test134 - failed, a.At(2): " + a[2] + " , but get: a.At(3): " + a[3]);
1838 let a = [0, 1, 2, ,4, 5, 6];
1839 let b = a.with(3, 6);
1848 let a = [1, 2, 3, 4, 5];
1849 a.push(5.5);
1850 if (a.length == 6 && a[5] == 5.5 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
1858 let a = [1, 2, 3, 4, 5];
1859 a.push(undefined);
1860 if (a.length == 6 && a[5] == undefined && ArkTools.getElementsKind(a) == PACKEDTAGGED) {
1868 let a = [1, 2, , 4, 5];
1871 const sumWithInitial = a.reduce(
1884 let a = [1, 2, , 4, 5];
1887 const sumWithInitial = a.reduceRight(
1900 let a = [1, 2, 3, 4, 5];
1901 a.reverse();
1902 if (a.length == 5 && ArkTools.getElementsKind(a) == PACKEDINT) {
1910 let a = [1, 2, , 4, 5];
1911 a.reverse();
1912 if (a.length == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
1921 let a = [0.1, 1, 2, 3, 4, 5, 6];
1922 let result = a.shift();
1923 if (a.length == 6 && result == 0.1 && ArkTools.getElementsKind(a) == PACKEDNUMBER) {
1932 let a = [0, 1, 2, , 4, 5, 6];
1933 let result = a.shift();
1934 if (a.length == 6 && result == 0 && ArkTools.getElementsKind(a) == HOLEINT) {
1943 let a = [0, 1, 2, , 4, 5, 6];
1944 let b = a.slice();
1953 let a = [1, , 4, 21, 100000];
1954 a.sort();
1955 if (a[0] == 1 && a[1] == 100000 && a.length == 5 && ArkTools.getElementsKind(a) == HOLEINT) {
1964 let a = [0, 1, 2, 3, 4, 5, 6];
1965 a.splice(2, 2, 3, 3);
1966 if (a.length == 7 && ArkTools.getElementsKind(a) == PACKEDINT) {
1975 let a = [0, 1, 2, , 4, 5, 6];
1976 a.splice(2, 1, 3);
1977 if (a.length == 7 && ArkTools.getElementsKind(a) == HOLEINT) {