Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit fa94799

Browse files
authored
README: maximumByteLengthmaxByteLength (#101)
1 parent 17b2feb commit fa94799

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

README.md

+18-18
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,16 @@ Having a resizable `ArrayBuffer` would let WebGPU explain repointing as a resize
5050

5151
```javascript
5252
class ArrayBuffer {
53-
// If the options parameter is not an object with a "maximumByteLength"
53+
// If the options parameter is not an object with a "maxByteLength"
5454
// property, the ArrayBuffer can neither grow nor shrink (status quo).
5555
// Otherwise it is resizable.
5656
//
5757
// A resizable ArrayBuffer can grow up to the provided
58-
// options.maximumByteLength and shrink.
58+
// options.maxByteLength and shrink.
5959
//
60-
// If options is an object with a "maximumByteLength" property,
61-
// - Throws a RangeError if maximumByteLength is not finite.
62-
// - Throws a RangeError if byteLength > maximumByteLength.
60+
// If options is an object with a "maxByteLength" property,
61+
// - Throws a RangeError if maxByteLength is not finite.
62+
// - Throws a RangeError if byteLength > maxByteLength.
6363
constructor(byteLength [, options ]);
6464

6565
// Returns a *non*-resizable ArrayBuffer with the same byte content
@@ -84,7 +84,7 @@ class ArrayBuffer {
8484
// no realloc.
8585
//
8686
// Throws a TypeError if the this value is not resizable.
87-
// Throws a RangeError unless 0 <= newByteLength <= this.maximumByteLength.
87+
// Throws a RangeError unless 0 <= newByteLength <= this.maxByteLength.
8888
//
8989
// Can throw OOM.
9090
resize(newByteLength);
@@ -102,7 +102,7 @@ class ArrayBuffer {
102102
// If not resizable, returns the byte length.
103103
//
104104
// No setter.
105-
get maximumByteLength();
105+
get maxByteLength();
106106

107107
// No setter.
108108
get byteLength();
@@ -114,9 +114,9 @@ class ArrayBuffer {
114114
Example:
115115
116116
```javascript
117-
let rab = new ArrayBuffer(1024, { maximumByteLength: 1024 ** 2 });
117+
let rab = new ArrayBuffer(1024, { maxByteLength: 1024 ** 2 });
118118
assert(rab.byteLength === 1024);
119-
assert(rab.maximumByteLength === 1024 ** 2);
119+
assert(rab.maxByteLength === 1024 ** 2);
120120
assert(rab.resizable);
121121

122122
rab.resize(rab.byteLength * 2);
@@ -126,7 +126,7 @@ assert(rab.byteLength === 1024 * 2);
126126
let ab = rab.transfer(1024);
127127
// rab is now detached
128128
assert(rab.byteLength === 0);
129-
assert(rab.maximumByteLength === 0);
129+
assert(rab.maxByteLength === 0);
130130

131131
// The contents are moved to ab.
132132
assert(!ab.resizable);
@@ -137,16 +137,16 @@ assert(ab.byteLength === 1024);
137137
138138
```javascript
139139
class SharedArrayBuffer {
140-
// If the options parameter is not an object with a "maximumByteLength"
140+
// If the options parameter is not an object with a "maxByteLength"
141141
// property, the SharedArrayBuffer cannot grow (status quo).
142142
// Otherwise it is growable.
143143
//
144144
// A growable SharedArrayBuffer can only grow up to the provided
145-
// options.maximumByteLength.
145+
// options.maxByteLength.
146146
//
147-
// If options is an object with a "maximumByteLength" property,
148-
// - Throws a RangeError if options.maximumByteLength is not finite.
149-
// - Throws a RangeError if byteLength > options.maximumByteLength.
147+
// If options is an object with a "maxByteLength" property,
148+
// - Throws a RangeError if options.maxByteLength is not finite.
149+
// - Throws a RangeError if byteLength > options.maxByteLength.
150150
constructor(byteLength [, options ]);
151151

152152
// Grows the buffer.
@@ -160,7 +160,7 @@ class SharedArrayBuffer {
160160
// Throws a TypeError if the `this` value is not a growable
161161
// SharedArrayBuffer.
162162
// Throws a RangeError unless
163-
// this.byteLength <= newByteLength <= this.maximumByteLength.
163+
// this.byteLength <= newByteLength <= this.maxByteLength.
164164
//
165165
// Can throw OOM.
166166
grow(newByteLength);
@@ -178,7 +178,7 @@ class SharedArrayBuffer {
178178
// If not resizable, returns the byte length.
179179
//
180180
// No setter.
181-
get maximumByteLength();
181+
get maxByteLength();
182182

183183
// No setter.
184184
get byteLength();
@@ -212,7 +212,7 @@ Growable `SharedArrayBuffer`s can only grow, so TAs backed by growable `SharedAr
212212
An example:
213213
214214
```javascript
215-
let rab = new ArrayBuffer(1024, { maximumByteLength: 1024 ** 2 });
215+
let rab = new ArrayBuffer(1024, { maxByteLength: 1024 ** 2 });
216216
// 0 offset, auto length
217217
let U32a = new Uint32Array(rab);
218218
assert(U32a.length === 256); // (1024 - 0) / 4

0 commit comments

Comments
 (0)