MCPcopy Create free account
hub / github.com/dop251/goja / DynamicArray

Interface DynamicArray

object_dynamic.go:49–61  ·  view source on GitHub ↗

* DynamicArray is an interface representing a handler for a dynamic array Object. Such an object can be created using the Runtime.NewDynamicArray() method. Any integer property key or a string property key that can be parsed into an int value (including negative ones) is treated as an index and pas

Source from the content-addressed store, hash-verified

47silent code breaks when this interface changes.
48*/
49type DynamicArray interface {
50 // Len returns the current array length.
51 Len() int
52 // Get an item at index idx. Note that idx may be any integer, negative or beyond the current length.
53 Get(idx int) Value
54 // Set an item at index idx. Note that idx may be any integer, negative or beyond the current length.
55 // The expected behaviour when it's beyond length is that the array's length is increased to accommodate
56 // the item. All elements in the 'new' section of the array should be zeroed.
57 Set(idx int, val Value) bool
58 // SetLen is called when the array's 'length' property is changed. If the length is increased all elements in the
59 // 'new' section of the array should be zeroed.
60 SetLen(int) bool
61}
62
63type baseDynamicObject struct {
64 val *Object

Callers 27

switchToUnicodeMethod · 0.65
exportToArrayOrSliceMethod · 0.65
escapeInvalidUtf16Function · 0.65
_putIdxMethod · 0.65
growMethod · 0.65
shrinkMethod · 0.65
putLengthMethod · 0.65
TestJSONMarshalObjectFunction · 0.65
BenchmarkJSONStringifyFunction · 0.65
TestSparseArraySwitchFunction · 0.65

Implementers 2

testDynArrayobject_dynamic_test.go
testSharedDynArrayobject_dynamic_test.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…