@@ -218,6 +218,36 @@ addObject(BUILTIN_SHAPES, BuiltInPropsId, [
218
218
219
219
/* Built-in array shape */
220
220
addObject ( BUILTIN_SHAPES , BuiltInArrayId , [
221
+ [
222
+ "indexOf" ,
223
+ addFunction ( BUILTIN_SHAPES , [ ] , {
224
+ positionalParams : [ ] ,
225
+ restParam : Effect . Read ,
226
+ returnType : { kind : "Primitive" } ,
227
+ calleeEffect : Effect . Read ,
228
+ returnValueKind : ValueKind . Primitive ,
229
+ } ) ,
230
+ ] ,
231
+ [
232
+ "includes" ,
233
+ addFunction ( BUILTIN_SHAPES , [ ] , {
234
+ positionalParams : [ ] ,
235
+ restParam : Effect . Read ,
236
+ returnType : { kind : "Primitive" } ,
237
+ calleeEffect : Effect . Read ,
238
+ returnValueKind : ValueKind . Primitive ,
239
+ } ) ,
240
+ ] ,
241
+ [
242
+ "pop" ,
243
+ addFunction ( BUILTIN_SHAPES , [ ] , {
244
+ positionalParams : [ ] ,
245
+ restParam : null ,
246
+ returnType : { kind : "Poly" } ,
247
+ calleeEffect : Effect . Store ,
248
+ returnValueKind : ValueKind . Mutable ,
249
+ } ) ,
250
+ ] ,
221
251
[
222
252
"at" ,
223
253
addFunction ( BUILTIN_SHAPES , [ ] , {
@@ -252,6 +282,19 @@ addObject(BUILTIN_SHAPES, BuiltInArrayId, [
252
282
returnValueKind : ValueKind . Primitive ,
253
283
} ) ,
254
284
] ,
285
+ [
286
+ "slice" ,
287
+ addFunction ( BUILTIN_SHAPES , [ ] , {
288
+ positionalParams : [ ] ,
289
+ restParam : Effect . Read ,
290
+ returnType : {
291
+ kind : "Object" ,
292
+ shapeId : BuiltInArrayId ,
293
+ } ,
294
+ calleeEffect : Effect . Capture ,
295
+ returnValueKind : ValueKind . Mutable ,
296
+ } ) ,
297
+ ] ,
255
298
[
256
299
"map" ,
257
300
addFunction ( BUILTIN_SHAPES , [ ] , {
@@ -353,7 +396,7 @@ addObject(BUILTIN_SHAPES, BuiltInArrayId, [
353
396
"join" ,
354
397
addFunction ( BUILTIN_SHAPES , [ ] , {
355
398
positionalParams : [ ] ,
356
- restParam : Effect . ConditionallyMutate ,
399
+ restParam : Effect . Read ,
357
400
returnType : PRIMITIVE_TYPE ,
358
401
calleeEffect : Effect . Read ,
359
402
returnValueKind : ValueKind . Primitive ,
@@ -478,6 +521,90 @@ addObject(BUILTIN_SHAPES, BuiltInMixedReadonlyId, [
478
521
noAlias : true ,
479
522
} ) ,
480
523
] ,
524
+ [
525
+ "concat" ,
526
+ addFunction ( BUILTIN_SHAPES , [ ] , {
527
+ positionalParams : [ ] ,
528
+ restParam : Effect . Capture ,
529
+ returnType : {
530
+ kind : "Object" ,
531
+ shapeId : BuiltInArrayId ,
532
+ } ,
533
+ calleeEffect : Effect . Capture ,
534
+ returnValueKind : ValueKind . Mutable ,
535
+ } ) ,
536
+ ] ,
537
+ [
538
+ "slice" ,
539
+ addFunction ( BUILTIN_SHAPES , [ ] , {
540
+ positionalParams : [ ] ,
541
+ restParam : Effect . Read ,
542
+ returnType : {
543
+ kind : "Object" ,
544
+ shapeId : BuiltInArrayId ,
545
+ } ,
546
+ calleeEffect : Effect . Capture ,
547
+ returnValueKind : ValueKind . Mutable ,
548
+ } ) ,
549
+ ] ,
550
+ [
551
+ "every" ,
552
+ addFunction ( BUILTIN_SHAPES , [ ] , {
553
+ positionalParams : [ ] ,
554
+ restParam : Effect . ConditionallyMutate ,
555
+ returnType : { kind : "Primitive" } ,
556
+ calleeEffect : Effect . ConditionallyMutate ,
557
+ returnValueKind : ValueKind . Primitive ,
558
+ noAlias : true ,
559
+ mutableOnlyIfOperandsAreMutable : true ,
560
+ } ) ,
561
+ ] ,
562
+ [
563
+ "some" ,
564
+ addFunction ( BUILTIN_SHAPES , [ ] , {
565
+ positionalParams : [ ] ,
566
+ restParam : Effect . ConditionallyMutate ,
567
+ returnType : { kind : "Primitive" } ,
568
+ calleeEffect : Effect . ConditionallyMutate ,
569
+ returnValueKind : ValueKind . Primitive ,
570
+ noAlias : true ,
571
+ mutableOnlyIfOperandsAreMutable : true ,
572
+ } ) ,
573
+ ] ,
574
+ [
575
+ "find" ,
576
+ addFunction ( BUILTIN_SHAPES , [ ] , {
577
+ positionalParams : [ ] ,
578
+ restParam : Effect . ConditionallyMutate ,
579
+ returnType : { kind : "Poly" } ,
580
+ calleeEffect : Effect . ConditionallyMutate ,
581
+ returnValueKind : ValueKind . Mutable ,
582
+ noAlias : true ,
583
+ mutableOnlyIfOperandsAreMutable : true ,
584
+ } ) ,
585
+ ] ,
586
+ [
587
+ "findIndex" ,
588
+ addFunction ( BUILTIN_SHAPES , [ ] , {
589
+ positionalParams : [ ] ,
590
+ restParam : Effect . ConditionallyMutate ,
591
+ returnType : { kind : "Primitive" } ,
592
+ calleeEffect : Effect . ConditionallyMutate ,
593
+ returnValueKind : ValueKind . Primitive ,
594
+ noAlias : true ,
595
+ mutableOnlyIfOperandsAreMutable : true ,
596
+ } ) ,
597
+ ] ,
598
+ [
599
+ "join" ,
600
+ addFunction ( BUILTIN_SHAPES , [ ] , {
601
+ positionalParams : [ ] ,
602
+ restParam : Effect . Read ,
603
+ returnType : PRIMITIVE_TYPE ,
604
+ calleeEffect : Effect . Read ,
605
+ returnValueKind : ValueKind . Primitive ,
606
+ } ) ,
607
+ ] ,
481
608
[ "*" , { kind : "Object" , shapeId : BuiltInMixedReadonlyId } ] ,
482
609
] ) ;
483
610
0 commit comments