package goja

import (
	
	
	

	
)

type objectGoSliceReflect struct {
	objectGoArrayReflect
}

func ( *objectGoSliceReflect) () {
	.objectGoArrayReflect._init()
	.lengthProp.writable = true
	.putIdx = ._putIdx
}

func ( *objectGoSliceReflect) ( int,  Value,  bool) bool {
	if  >= .fieldsValue.Len() {
		.grow( + 1)
	}
	return .objectGoArrayReflect._putIdx(, , )
}

func ( *objectGoSliceReflect) ( int) {
	 := .fieldsValue.Cap()
	if  <  {
		 := reflect.MakeSlice(.fieldsValue.Type(), , growCap(, .fieldsValue.Len(), ))
		reflect.Copy(, .fieldsValue)
		.fieldsValue.Set()
		 := len(.valueCache)
		if  >  {
			 = 
		}
		for ,  := range .valueCache[:] {
			if  != nil {
				.setReflectValue(.fieldsValue.Index())
			}
		}
	} else {
		 := .fieldsValue.Slice(.fieldsValue.Len(), )
		 := reflect.Zero(.fieldsValue.Type().Elem())
		for  := 0;  < .Len(); ++ {
			.Index().Set()
		}
		.fieldsValue.SetLen()
	}
}

func ( *objectGoSliceReflect) ( int) {
	.valueCache.shrink()
	 := .fieldsValue.Slice(, .fieldsValue.Len())
	 := reflect.Zero(.fieldsValue.Type().Elem())
	for  := 0;  < .Len(); ++ {
		.Index().Set()
	}
	.fieldsValue.SetLen()
}

func ( *objectGoSliceReflect) ( uint32,  bool) bool {
	if bits.UintSize == 32 &&  > math.MaxInt32 {
		panic(rangeError("Integer value overflows 32-bit int"))
	}
	 := int()
	 := .fieldsValue.Len()
	if  >  {
		.grow()
	} else if  <  {
		.shrink()
	}
	return true
}

func ( *objectGoSliceReflect) ( unistring.String,  Value,  bool) bool {
	if  == "length" {
		return .putLength(.val.runtime.toLengthUint32(), )
	}
	return .objectGoArrayReflect.setOwnStr(, , )
}

func ( *objectGoSliceReflect) ( unistring.String,  PropertyDescriptor,  bool) bool {
	if  == "length" {
		return .val.runtime.defineArrayLength(&.lengthProp, , .putLength, )
	}
	return .objectGoArrayReflect.defineOwnPropertyStr(, , )
}