@@ -50,16 +50,16 @@ Having a resizable `ArrayBuffer` would let WebGPU explain repointing as a resize
50
50
51
51
``` javascript
52
52
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 "
54
54
// property, the ArrayBuffer can neither grow nor shrink (status quo).
55
55
// Otherwise it is resizable.
56
56
//
57
57
// A resizable ArrayBuffer can grow up to the provided
58
- // options.maximumByteLength and shrink.
58
+ // options.maxByteLength and shrink.
59
59
//
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 .
63
63
constructor (byteLength [, options ]);
64
64
65
65
// Returns a *non*-resizable ArrayBuffer with the same byte content
@@ -84,7 +84,7 @@ class ArrayBuffer {
84
84
// no realloc.
85
85
//
86
86
// 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 .
88
88
//
89
89
// Can throw OOM.
90
90
resize(newByteLength);
@@ -102,7 +102,7 @@ class ArrayBuffer {
102
102
// If not resizable, returns the byte length.
103
103
//
104
104
// No setter.
105
- get maximumByteLength ();
105
+ get maxByteLength ();
106
106
107
107
// No setter.
108
108
get byteLength();
@@ -114,9 +114,9 @@ class ArrayBuffer {
114
114
Example:
115
115
116
116
` ` ` javascript
117
- let rab = new ArrayBuffer (1024 , { maximumByteLength : 1024 ** 2 });
117
+ let rab = new ArrayBuffer (1024 , { maxByteLength : 1024 ** 2 });
118
118
assert (rab .byteLength === 1024 );
119
- assert (rab .maximumByteLength === 1024 ** 2 );
119
+ assert (rab .maxByteLength === 1024 ** 2 );
120
120
assert (rab .resizable );
121
121
122
122
rab .resize (rab .byteLength * 2 );
@@ -126,7 +126,7 @@ assert(rab.byteLength === 1024 * 2);
126
126
let ab = rab .transfer (1024 );
127
127
// rab is now detached
128
128
assert (rab .byteLength === 0 );
129
- assert (rab .maximumByteLength === 0 );
129
+ assert (rab .maxByteLength === 0 );
130
130
131
131
// The contents are moved to ab.
132
132
assert (! ab .resizable );
@@ -137,16 +137,16 @@ assert(ab.byteLength === 1024);
137
137
138
138
` ` ` javascript
139
139
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 "
141
141
// property, the SharedArrayBuffer cannot grow (status quo).
142
142
// Otherwise it is growable.
143
143
//
144
144
// A growable SharedArrayBuffer can only grow up to the provided
145
- // options.maximumByteLength .
145
+ // options.maxByteLength .
146
146
//
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 .
150
150
constructor (byteLength [, options ]);
151
151
152
152
// Grows the buffer.
@@ -160,7 +160,7 @@ class SharedArrayBuffer {
160
160
// Throws a TypeError if the `this` value is not a growable
161
161
// SharedArrayBuffer.
162
162
// Throws a RangeError unless
163
- // this.byteLength <= newByteLength <= this.maximumByteLength .
163
+ // this.byteLength <= newByteLength <= this.maxByteLength .
164
164
//
165
165
// Can throw OOM.
166
166
grow(newByteLength);
@@ -178,7 +178,7 @@ class SharedArrayBuffer {
178
178
// If not resizable, returns the byte length.
179
179
//
180
180
// No setter.
181
- get maximumByteLength ();
181
+ get maxByteLength ();
182
182
183
183
// No setter.
184
184
get byteLength();
@@ -212,7 +212,7 @@ Growable `SharedArrayBuffer`s can only grow, so TAs backed by growable `SharedAr
212
212
An example:
213
213
214
214
` ` ` javascript
215
- let rab = new ArrayBuffer (1024 , { maximumByteLength : 1024 ** 2 });
215
+ let rab = new ArrayBuffer (1024 , { maxByteLength : 1024 ** 2 });
216
216
// 0 offset, auto length
217
217
let U32a = new Uint32Array (rab);
218
218
assert (U32a .length === 256 ); // (1024 - 0) / 4
0 commit comments