diff --git a/std/assembly/array.ts b/std/assembly/array.ts index cc54a6be57..4dccd5287f 100644 --- a/std/assembly/array.ts +++ b/std/assembly/array.ts @@ -33,7 +33,7 @@ export class Array { // `dataStart` (equals `buffer`) and `byteLength` (equals computed `buffer.byteLength`), but the // block is 16 bytes anyway so it's fine to have a couple extra fields in there. - private buffer: ArrayBuffer; + readonly buffer: ArrayBuffer; private dataStart: usize; private byteLength: i32; diff --git a/std/assembly/index.d.ts b/std/assembly/index.d.ts index af2c7f4181..3933899552 100644 --- a/std/assembly/index.d.ts +++ b/std/assembly/index.d.ts @@ -1575,11 +1575,12 @@ declare class Array { static isArray(value: any): value is Array; [key: number]: T; + /** The {@link ArrayBuffer} referenced by this view. */ + readonly buffer: ArrayBuffer; /** Current length of the array. */ length: i32; /** Constructs a new array. */ constructor(capacity?: i32); - at(index: i32): T; fill(value: T, start?: i32, end?: i32): this; every(callbackfn: (element: T, index: i32, array?: Array) => bool): bool;